]> cat aescling's git repositories - mastodon.git/commitdiff
Fix old migrations failing because of new version of `strong_migrations`
authorThibaut Girka <thib@sitedethib.com>
Sun, 9 Jun 2019 20:31:23 +0000 (22:31 +0200)
committerThibG <thib@sitedethib.com>
Sun, 9 Jun 2019 20:32:12 +0000 (22:32 +0200)
Fixes #1099

db/migrate/20180402040909_create_report_notes.rb
db/migrate/20180707193142_migrate_filters.rb

index 732ddf8259cb8d1168a8ac8ee6cc32a6b91b5c92..429cb453495d015e84074f74b165d9b06b30a0ac 100644 (file)
@@ -8,7 +8,7 @@ class CreateReportNotes < ActiveRecord::Migration[5.1]
       t.timestamps
     end
 
-    add_foreign_key :report_notes, :reports, column: :report_id, on_delete: :cascade
-    add_foreign_key :report_notes, :accounts, column: :account_id, on_delete: :cascade
+    safety_assured { add_foreign_key :report_notes, :reports, column: :report_id, on_delete: :cascade }
+    safety_assured { add_foreign_key :report_notes, :accounts, column: :account_id, on_delete: :cascade }
   end
 end
index 10b814c0f592d97d4bb3d511dd3de262db1e6df7..067c5335798cebab1bdb686152c62baf92aa4a89 100644 (file)
@@ -41,7 +41,7 @@ class MigrateFilters < ActiveRecord::Migration[5.2]
         t.timestamps
       end
 
-      add_foreign_key :glitch_keyword_mutes, :accounts, on_delete: :cascade
+      safety_assured { add_foreign_key :glitch_keyword_mutes, :accounts, on_delete: :cascade }
     end
 
     CustomFilter.where(irreversible: true).find_each do |filter|