2016-08-08 10:01:25 +00:00
|
|
|
class AddIndexForBuildToken < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
# Set this constant to true if this migration requires downtime.
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-03-07 16:08:53 +00:00
|
|
|
def up
|
2016-08-08 10:01:25 +00:00
|
|
|
add_concurrent_index :ci_builds, :token, unique: true
|
|
|
|
end
|
2017-03-07 16:08:53 +00:00
|
|
|
|
|
|
|
def down
|
|
|
|
remove_index :ci_builds, :token, unique: true if index_exists? :ci_builds, :token, unique: true
|
|
|
|
end
|
2016-08-08 10:01:25 +00:00
|
|
|
end
|