Update fix-duplicates maintenance script to support latest migrations (#16231)

* Update maintenance script to support latest database migrations

* Update Account#merge_with!
This commit is contained in:
Claire 2021-05-12 23:19:44 +02:00 committed by GitHub
parent 2840f995d5
commit 76064e6608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View file

@ -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}:*")