mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Update api keys migration to check for existing index
This commit is contained in:
@@ -8,8 +8,8 @@ class CreateApiKeys < ActiveRecord::Migration[8.0]
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :api_keys, :token, unique: true
|
||||
add_index :api_keys, [ :user_id, :token ], unique: true
|
||||
add_index :api_keys, [ :user_id, :name ], unique: true
|
||||
add_index :api_keys, :token, unique: true, if_not_exists: true
|
||||
add_index :api_keys, [ :user_id, :token ], unique: true, if_not_exists: true
|
||||
add_index :api_keys, [ :user_id, :name ], unique: true, if_not_exists: true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user