[migration] make this index creation conditional

This commit is contained in:
Fosco Marotto 2020-12-12 16:46:53 -08:00
parent 532bac229a
commit f0d4e89279

View File

@ -2,6 +2,8 @@ class AddIndexToStatusesReply < ActiveRecord::Migration[5.2]
disable_ddl_transaction! disable_ddl_transaction!
def change def change
if !index_exists?(:statuses, :reply)
add_index :statuses, :reply, algorithm: :concurrently add_index :statuses, :reply, algorithm: :concurrently
end end
end
end end