Add index to speed up loading projects from DeployToken
This commit is contained in:
parent
961d43a97b
commit
c4bcb3a92a
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToProjectDeployTokensDeployTokenId < ActiveRecord::Migration
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_index :project_deploy_tokens, :deploy_token_id
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index(:project_deploy_tokens, :deploy_token_id) if Gitlab::Database.postgresql?
|
||||
end
|
||||
end
|
|
@ -1588,6 +1588,7 @@ ActiveRecord::Schema.define(version: 20181101144347) do
|
|||
t.datetime_with_timezone "created_at", null: false
|
||||
end
|
||||
|
||||
add_index "project_deploy_tokens", ["deploy_token_id"], name: "index_project_deploy_tokens_on_deploy_token_id", using: :btree
|
||||
add_index "project_deploy_tokens", ["project_id", "deploy_token_id"], name: "index_project_deploy_tokens_on_project_id_and_deploy_token_id", unique: true, using: :btree
|
||||
|
||||
create_table "project_features", force: :cascade do |t|
|
||||
|
|
Loading…
Reference in New Issue