]> cat aescling's git repositories - mastodon.git/commitdiff
Fix old migrations failing because of new version of `strong_migrations`
authorThibaut Girka <thib@sitedethib.com>
Thu, 30 May 2019 19:12:02 +0000 (21:12 +0200)
committerThibG <thib@sitedethib.com>
Thu, 30 May 2019 19:20:42 +0000 (21:20 +0200)
db/migrate/20171009222537_create_keyword_mutes.rb
db/migrate/20180410220657_create_bookmarks.rb

index ec0c756fbf3a140a7128abed705776ffd97486ba..66411ba1d960b8f998f0ac7438f7a92e4db4776b 100644 (file)
@@ -7,6 +7,6 @@ class CreateKeywordMutes < ActiveRecord::Migration[5.1]
       t.timestamps
     end
 
-    add_foreign_key :keyword_mutes, :accounts, on_delete: :cascade
+    safety_assured { add_foreign_key :keyword_mutes, :accounts, on_delete: :cascade }
   end
 end
index 208da452bfedea946a8cd8db32ba411a5bee8a1a..08d22c10d9e98e76047557d4816b117e7c5cc9e9 100644 (file)
@@ -7,8 +7,8 @@ class CreateBookmarks < ActiveRecord::Migration[5.1]
       t.timestamps
     end
 
-    add_foreign_key :bookmarks, :accounts, column: :account_id, on_delete: :cascade
-    add_foreign_key :bookmarks, :statuses, column: :status_id, on_delete: :cascade
+    safety_assured { add_foreign_key :bookmarks, :accounts, column: :account_id, on_delete: :cascade }
+    safety_assured { add_foreign_key :bookmarks, :statuses, column: :status_id, on_delete: :cascade }
     add_index :bookmarks, [:account_id, :status_id], unique: true
   end
 end