]> cat aescling's git repositories - mastodon.git/commitdiff
Fix old migrations failing because of new version of `strong_migrations` (#10904)
authorThibG <thib@sitedethib.com>
Thu, 30 May 2019 19:35:29 +0000 (21:35 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 30 May 2019 19:35:29 +0000 (22:35 +0300)
db/migrate/20171005102658_create_account_moderation_notes.rb
db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb
db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb

index 974ed9940381cd7ac9f960957317bb2b80659f3a..010b94586e163ca5229d4b3323c6086ed76e0029 100644 (file)
@@ -8,6 +8,6 @@ class CreateAccountModerationNotes < ActiveRecord::Migration[5.1]
       t.timestamps
     end
 
-    add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id
+    safety_assured { add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id }
   end
 end
index fc1e1ab912594b7997e6da13c7679d13b9fcdb7c..cdcd159349895508142bcc936394d903ea4774bd 100644 (file)
@@ -1,5 +1,5 @@
 class AddForeignKeyToAccountModerationNotes < ActiveRecord::Migration[5.1]
   def change
-    add_foreign_key :account_moderation_notes, :accounts
+    safety_assured { add_foreign_key :account_moderation_notes, :accounts }
   end
 end
index 0c8a894cca27c9105e4561f00f31032e454fb62d..586ef6f02d26dc92a7cc012bf98074585843a9cd 100644 (file)
@@ -1,6 +1,6 @@
 class AddMovedToAccountIdToAccounts < ActiveRecord::Migration[5.1]
   def change
     add_column :accounts, :moved_to_account_id, :bigint, null: true, default: nil
-    add_foreign_key :accounts, :accounts, column: :moved_to_account_id, on_delete: :nullify
+    safety_assured { add_foreign_key :accounts, :accounts, column: :moved_to_account_id, on_delete: :nullify }
   end
 end