[migration] make this index creation conditional
This commit is contained in:
parent
532bac229a
commit
f0d4e89279
|
@ -2,6 +2,8 @@ class AddIndexToStatusesReply < ActiveRecord::Migration[5.2]
|
||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def change
|
def change
|
||||||
add_index :statuses, :reply, algorithm: :concurrently
|
if !index_exists?(:statuses, :reply)
|
||||||
|
add_index :statuses, :reply, algorithm: :concurrently
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue