PERF: allow looking up incoming email by user_id

This speeds up the ability to remove users from the system
This commit is contained in:
Sam Saffron
2019-04-26 22:33:01 +10:00
parent 26b4dbde41
commit 378fe1c1cf
2 changed files with 6 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
class AddIncomingEmailByUserIdIndex < ActiveRecord::Migration[5.2]
def change
add_index :incoming_emails, [:user_id], where: 'user_id IS NOT NULL'
end
end