20180927073410_add_index_to_project_deploy_tokens_deploy_token_id.rb 481 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class AddIndexToProjectDeployTokensDeployTokenId < ActiveRecord::Migration[4.2]
4 5 6 7 8 9 10
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
Mark Chao's avatar
Mark Chao committed
11 12
    # MySQL already has index inserted
    add_concurrent_index :project_deploy_tokens, :deploy_token_id if Gitlab::Database.postgresql?
13 14 15 16 17 18
  end

  def down
    remove_concurrent_index(:project_deploy_tokens, :deploy_token_id) if Gitlab::Database.postgresql?
  end
end