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