2018-04-25 12:03:35 +00:00
|
|
|
class AddIndexConstraintsToPipelineIid < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2018-04-25 13:00:11 +00:00
|
|
|
add_concurrent_index :ci_pipelines, [:project_id, :iid], unique: true, where: 'iid IS NOT NULL'
|
2018-04-25 12:03:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2018-04-25 13:00:11 +00:00
|
|
|
remove_concurrent_index :ci_pipelines, [:project_id, :iid]
|
2018-04-25 12:03:35 +00:00
|
|
|
end
|
|
|
|
end
|