2021-03-08 18:12:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class DropTemporaryIndexOnCiBuilds < ActiveRecord::Migration[6.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
INDEX = 'tmp_build_stage_position_index'
|
2021-03-08 18:12:59 +05:30
|
|
|
|
|
|
|
def up
|
|
|
|
remove_concurrent_index_by_name :ci_builds, INDEX
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
add_concurrent_index :ci_builds, [:stage_id, :stage_idx], where: 'stage_idx IS NOT NULL', name: INDEX
|
|
|
|
end
|
|
|
|
end
|