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

16 lines
444 B
Ruby

class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:ci_builds, [:stage_id, :stage_idx],
where: 'stage_idx IS NOT NULL', name: 'tmp_build_stage_position_index')
end
def down
remove_concurrent_index_by_name(:ci_builds, 'tmp_build_stage_position_index')
end
end