]> cat aescling's git repositories - mastodon.git/commitdiff
Fix index detection a migration to revert index change (#8026)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Sun, 15 Jul 2018 12:56:00 +0000 (21:56 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 15 Jul 2018 12:56:00 +0000 (14:56 +0200)
db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb

index 4a8761fec3d2126e2a431cf47250fd564663b3fc..ccd2ec7eac575646d673e0cbc8f35a0212f4d4c9 100644 (file)
@@ -5,7 +5,7 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
 
   def change
     safety_assured do
-      add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_exists?(:statuses, name: "index_statuses_20180106")
+      add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, "index_statuses_20180106")
     end
 
     # These index may not exists (see migration 20180514130000)