Commit 64e24d64 authored by Etienne Baqué's avatar Etienne Baqué Committed by Stan Hu

Added new index to deploy_tokens table

parent 84d6dcbe
# 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|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment