diff --git a/db/migrate/20200806162649_add_index_to_statuses_reply.rb b/db/migrate/20200806162649_add_index_to_statuses_reply.rb index 8298dc61..b0d664cc 100644 --- a/db/migrate/20200806162649_add_index_to_statuses_reply.rb +++ b/db/migrate/20200806162649_add_index_to_statuses_reply.rb @@ -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