From 76064e66084db6c788ec616b4aba8b6584a7828b Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 12 May 2021 23:19:44 +0200 Subject: Update fix-duplicates maintenance script to support latest migrations (#16231) * Update maintenance script to support latest database migrations * Update Account#merge_with! --- app/models/concerns/account_merging.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') 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}:*") -- cgit