Added new index to deploy_tokens table
This commit is contained in:
parent
84d6dcbe50
commit
64e24d6492
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToDeployTokensTokenEncrypted < ActiveRecord::Migration[5.1]
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_index :deploy_tokens, :token_encrypted, unique: true, name: "index_deploy_tokens_on_token_encrypted"
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :deploy_tokens, "index_deploy_tokens_on_token_encrypted"
|
||||
end
|
||||
end
|
|
@ -1126,6 +1126,7 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do
|
|||
t.string "token_encrypted"
|
||||
t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)"
|
||||
t.index ["token"], name: "index_deploy_tokens_on_token", unique: true
|
||||
t.index ["token_encrypted"], name: "index_deploy_tokens_on_token_encrypted", unique: true
|
||||
end
|
||||
|
||||
create_table "deployments", id: :serial, force: :cascade do |t|
|
||||
|
|
Loading…
Reference in New Issue