perf: add index on invite dossier_id

This commit is contained in:
simon lehericey 2022-10-05 11:23:49 +02:00 committed by LeSim
parent 7de9d76aa4
commit 95430b2ee8
2 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,7 @@
class AddIndexOnDossierIdToInvites < ActiveRecord::Migration[6.1]
include Database::MigrationHelpers
disable_ddl_transaction!
def up
add_concurrent_index :invites, [:dossier_id]
end
end

View file

@ -562,6 +562,7 @@ ActiveRecord::Schema.define(version: 2022_10_05_145646) do
t.text "message"
t.datetime "updated_at"
t.integer "user_id"
t.index ["dossier_id"], name: "index_invites_on_dossier_id"
t.index ["email", "dossier_id"], name: "index_invites_on_email_and_dossier_id", unique: true
end