diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-05-12 23:19:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 23:19:44 +0200 |
commit | 76064e66084db6c788ec616b4aba8b6584a7828b (patch) | |
tree | 9c6915a05c8acb29d89f3c3e728eaa50a721b42c /app | |
parent | 2840f995d501454686cbc9a0d5e2a55fc1f39cfb (diff) |
Update fix-duplicates maintenance script to support latest migrations (#16231)
* Update maintenance script to support latest database migrations * Update Account#merge_with!
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/account_merging.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account_merging.rb index c3b7018f2..8d37c6e56 100644 --- a/app/models/concerns/account_merging.rb +++ b/app/models/concerns/account_merging.rb @@ -15,7 +15,7 @@ module AccountMerging Status, StatusPin, MediaAttachment, Poll, Report, Tombstone, Favourite, Follow, FollowRequest, Block, Mute, AccountIdentityProof, AccountModerationNote, AccountPin, AccountStat, ListAccount, - PollVote, Mention, AccountDeletionRequest, AccountNote + PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression ] owned_classes.each do |klass| @@ -43,6 +43,10 @@ module AccountMerging end end + CanonicalEmailBlock.where(reference_account_id: other_account.id).find_each do |record| + record.update_attribute(:reference_account_id, id) + end + # Some follow relationships have moved, so the cache is stale Rails.cache.delete_matched("followers_hash:#{id}:*") Rails.cache.delete_matched("relationships:#{id}:*") |