debian-mirror-gitlab/db/migrate/20160808085602_add_index_for_build_token.rb
2019-02-15 15:39:39 +05:30

18 lines
445 B
Ruby

# rubocop:disable RemoveIndex
class AddIndexForBuildToken < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_builds, :token, unique: true
end
def down
remove_index :ci_builds, :token, unique: true if index_exists? :ci_builds, :token, unique: true
end
end