2018-11-13 07:27:31 +00:00
|
|
|
class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration[4.2]
|
2018-04-25 13:14:01 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_concurrent_index(:ci_builds, [:stage_id, :stage_idx],
|
2018-05-01 12:30:44 +00:00
|
|
|
where: 'stage_idx IS NOT NULL', name: 'tmp_build_stage_position_index')
|
2018-04-25 13:14:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2018-05-01 12:30:44 +00:00
|
|
|
remove_concurrent_index_by_name(:ci_builds, 'tmp_build_stage_position_index')
|
2018-04-25 13:14:01 +00:00
|
|
|
end
|
|
|
|
end
|