Use if_exists: true when removing duplicate indexes (#35309)

This commit is contained in:
Matt Jankowski 2025-07-09 04:45:29 -04:00 committed by GitHub
parent fb6c22f5c2
commit 1e2d77f2c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,11 @@
class RemoveDuplicateIndexes < ActiveRecord::Migration[7.1]
def change
remove_index :account_aliases, :account_id
remove_index :account_relationship_severance_events, :account_id
remove_index :custom_filter_statuses, :status_id
remove_index :webauthn_credentials, :user_id
with_options if_exists: true do
remove_index :account_aliases, :account_id
remove_index :account_relationship_severance_events, :account_id
remove_index :custom_filter_statuses, :status_id
remove_index :webauthn_credentials, :user_id
end
end
end