DEV: Drop 'key' column from user_api_keys (#9388)

This commit is contained in:
Dan Ungureanu
2020-04-22 12:13:19 +03:00
committed by GitHub
parent 5c45363e67
commit 4e5f9d4cd1
5 changed files with 17 additions and 8 deletions

View File

@@ -28,7 +28,6 @@ class UserApiKey < ActiveRecord::Base
def generate_key
if !self.key_hash
@key ||= SecureRandom.hex
self.key = @key
self.key_hash = ApiKey.hash_key(@key)
end
end
@@ -102,7 +101,6 @@ end
# id :integer not null, primary key
# user_id :integer not null
# client_id :string not null
# key :string not null
# application_name :string not null
# push_url :string
# created_at :datetime not null
@@ -115,7 +113,6 @@ end
# Indexes
#
# index_user_api_keys_on_client_id (client_id) 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)
#