PERF: add index on user auth tokens (for user lookups)
This speeds up user destroy cause we cascade looking up all the tokens for a user
This commit is contained in:
parent
378fe1c1cf
commit
b8c65cc6cf
|
@ -242,4 +242,5 @@ end
|
|||
#
|
||||
# index_user_auth_tokens_on_auth_token (auth_token) UNIQUE
|
||||
# index_user_auth_tokens_on_prev_auth_token (prev_auth_token) UNIQUE
|
||||
# index_user_auth_tokens_on_user_id (user_id)
|
||||
#
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexOnUserAuthTokenUser < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_index :user_auth_tokens, [:user_id]
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue