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:
parent
26b4dbde41
commit
378fe1c1cf
|
@ -52,4 +52,5 @@ end
|
|||
# index_incoming_emails_on_error (error)
|
||||
# index_incoming_emails_on_message_id (message_id)
|
||||
# index_incoming_emails_on_post_id (post_id)
|
||||
# index_incoming_emails_on_user_id (user_id) WHERE (user_id IS NOT NULL)
|
||||
#
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue