From f96743fcfba02b6ada899cf83a74ddc51de9189e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 9 Jul 2025 04:45:29 -0400 Subject: [PATCH] Use `if_exists: true` when removing duplicate indexes (#35309) --- db/migrate/20241014010506_remove_duplicate_indexes.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/db/migrate/20241014010506_remove_duplicate_indexes.rb b/db/migrate/20241014010506_remove_duplicate_indexes.rb index 50e0e6ffcfc..0c71936c431 100644 --- a/db/migrate/20241014010506_remove_duplicate_indexes.rb +++ b/db/migrate/20241014010506_remove_duplicate_indexes.rb @@ -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