Fix account merging in maintenance script (#15264)

Also include AccountNote and AccountDeletionRequest to the list of classes
needing to be reassigned the merged account.
This commit is contained in:
ThibG
2020-12-04 02:23:51 +01:00
committed by GitHub
parent d849aad852
commit fbe7519243
2 changed files with 49 additions and 3 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
PollVote, Mention, AccountDeletionRequest, AccountNote
]
owned_classes.each do |klass|
@ -28,7 +28,10 @@ module AccountMerging
end
end
target_classes = [Follow, FollowRequest, Block, Mute, AccountModerationNote, AccountPin]
target_classes = [
Follow, FollowRequest, Block, Mute, AccountModerationNote, AccountPin,
AccountNote
]
target_classes.each do |klass|
klass.where(target_account_id: other_account.id).find_each do |record|