debian-mirror-gitlab/db/migrate/20200903092241_add_index_to_resource_iteration_events_add_events.rb
2020-11-24 15:15:51 +05:30

22 lines
581 B
Ruby

# frozen_string_literal: true
class AddIndexToResourceIterationEventsAddEvents < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
INDEX_NAME = 'index_resource_iteration_events_on_iteration_id_and_add_action'
ADD_ACTION = '1'
def up
# Index add iteration events
add_concurrent_index :resource_iteration_events, :iteration_id, where: "action = #{ADD_ACTION}", name: INDEX_NAME
end
def down
remove_concurrent_index :resource_iteration_events, :iteration_id, name: INDEX_NAME
end
end