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

14 lines
451 B
Ruby

# frozen_string_literal: true
class ImproveIndexOnEventsForCalendar < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'
def up
prepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
end
def down
unprepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
end
end