]> cat aescling's git repositories - mastodon.git/commitdiff
Fix the migration error when deprecated_preview_cards has been deleted (#5043)
authornullkal <nullkal@nil.nu>
Fri, 22 Sep 2017 17:32:57 +0000 (02:32 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 22 Sep 2017 17:32:57 +0000 (19:32 +0200)
* Fix the migration error when deprecated_preview_cards has deleted

* Re-run Travis CI

db/migrate/20170918125918_ids_to_bigints.rb

index 9c81ecc05e56173ebb5fe921a621ac82f14c363d..7483dd77a44f453444390ad7cd2d48edc13cb842 100644 (file)
@@ -8,7 +8,7 @@ class IdsToBigints < ActiveRecord::Migration[5.1]
     change_column :blocks, :target_account_id, :bigint
     change_column :conversation_mutes, :account_id, :bigint
     change_column :conversation_mutes, :id, :bigint
-    change_column :deprecated_preview_cards, :id, :bigint
+    change_column :deprecated_preview_cards, :id, :bigint if table_exists?(:deprecated_preview_cards)
     change_column :domain_blocks, :id, :bigint
     change_column :favourites, :account_id, :bigint
     change_column :favourites, :id, :bigint
@@ -71,7 +71,7 @@ class IdsToBigints < ActiveRecord::Migration[5.1]
     change_column :blocks, :target_account_id, :integer
     change_column :conversation_mutes, :account_id, :integer
     change_column :conversation_mutes, :id, :integer
-    change_column :deprecated_preview_cards, :id, :integer
+    change_column :deprecated_preview_cards, :id, :integer if table_exists?(:deprecated_preview_cards)
     change_column :domain_blocks, :id, :integer
     change_column :favourites, :account_id, :integer
     change_column :favourites, :id, :integer