Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indexes to fields commonly used in queries to build emails #9551

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 4 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_06_25_105759) do
ActiveRecord::Schema[7.1].define(version: 2024_07_11_122121) do
create_sequence "qualifications_public_id_seq", start: 120000

# These are extensions that must be enabled in order to support this database
Expand Down Expand Up @@ -378,9 +378,12 @@
t.boolean "unsubscribed_from_emails", default: false
t.boolean "submission_blocked", default: false, null: false
t.boolean "account_locked", default: false, 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