2018-09-27 07:54:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-13 07:27:31 +00:00
|
|
|
class AddIndexToProjectDeployTokensDeployTokenId < ActiveRecord::Migration[4.2]
|
2018-09-27 07:54:01 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2018-10-29 10:36:32 +00:00
|
|
|
# MySQL already has index inserted
|
|
|
|
add_concurrent_index :project_deploy_tokens, :deploy_token_id if Gitlab::Database.postgresql?
|
2018-09-27 07:54:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_concurrent_index(:project_deploy_tokens, :deploy_token_id) if Gitlab::Database.postgresql?
|
|
|
|
end
|
|
|
|
end
|