FIX: Add index on user_api_keys.key_hash (#9387)

This commit is contained in:
Dan Ungureanu 2020-04-08 19:49:18 +03:00 committed by GitHub
parent 84f344c5d1
commit b64b590cfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -116,5 +116,6 @@ end
# #
# index_user_api_keys_on_client_id (client_id) UNIQUE # index_user_api_keys_on_client_id (client_id) UNIQUE
# index_user_api_keys_on_key (key) UNIQUE # index_user_api_keys_on_key (key) UNIQUE
# index_user_api_keys_on_key_hash (key_hash) UNIQUE
# index_user_api_keys_on_user_id (user_id) # index_user_api_keys_on_user_id (user_id)
# #

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddIndexToUserApiKeyOnKeyHash < ActiveRecord::Migration[6.0]
def change
add_index :user_api_keys, :key_hash, unique: true
end
end