about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180528141303_fix_accounts_unique_index.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/migrate/20180528141303_fix_accounts_unique_index.rb b/db/migrate/20180528141303_fix_accounts_unique_index.rb
index e949436dc..96cee37f9 100644
--- a/db/migrate/20180528141303_fix_accounts_unique_index.rb
+++ b/db/migrate/20180528141303_fix_accounts_unique_index.rb
@@ -73,15 +73,17 @@ class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
       klass.where(account_id: duplicate_account.id).find_each do |record|
         begin
           record.update_attribute(:account_id, main_account.id)
-        rescue PG::UniqueViolation
+        rescue ActiveRecord::RecordNotUnique
           next
         end
       end
+    end
 
+    [Follow, FollowRequest, Block, Mute].each do |klass|
       klass.where(target_account_id: duplicate_account.id).find_each do |record|
         begin
           record.update_attribute(:target_account_id, main_account.id)
-        rescue PG::UniqueViolation
+        rescue ActiveRecord::RecordNotUnique
           next
         end
       end