Skip to content

Commit

Permalink
Add indexes to fields commonly filtered on for sending emails
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee authored and dcyoung-dev committed Jan 9, 2025
1 parent faff8bb commit 3df38f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 3df38f0

Please sign in to comment.