debian-mirror-gitlab/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb
2022-01-26 12:08:38 +05:30

16 lines
428 B
Ruby

# frozen_string_literal: true
class CreateCalendarEventsIndexSynchronously < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'
def up
add_concurrent_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :events, INDEX_NAME
end
end