diff --git a/db/migrate/20240711122121_add_indexes_to_email_related_filters.rb b/db/migrate/20240711122121_add_indexes_to_email_related_filters.rb new file mode 100644 index 00000000000..165c4ade97e --- /dev/null +++ b/db/migrate/20240711122121_add_indexes_to_email_related_filters.rb @@ -0,0 +1,9 @@ +class AddIndexesToEmailRelatedFilters < ActiveRecord::Migration[7.1] + disable_ddl_transaction! + + def change + add_index :candidates, :submission_blocked, algorithm: :concurrently + add_index :candidates, :account_locked, algorithm: :concurrently + add_index :candidates, :unsubscribed_from_emails, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index ae2c4c7cea2..d19d25f173d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -400,9 +400,12 @@ t.boolean "submission_blocked", default: false, null: false t.boolean "account_locked", default: false, null: false t.string "account_recovery_status", default: "not_started", null: false + t.index ["account_locked"], name: "index_candidates_on_account_locked" t.index ["email_address"], name: "index_candidates_on_email_address", unique: true t.index ["fraud_match_id"], name: "index_candidates_on_fraud_match_id" t.index ["magic_link_token"], name: "index_candidates_on_magic_link_token", unique: true + t.index ["submission_blocked"], name: "index_candidates_on_submission_blocked" + t.index ["unsubscribed_from_emails"], name: "index_candidates_on_unsubscribed_from_emails" end create_table "chasers_sent", force: :cascade do |t|