Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230619072744_schedule_index_events_on_project_id_and_id_desc_on_merged_action_for_removal.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b73ddfffad640366b300ead2ddb48af62ff47817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class ScheduleIndexEventsOnProjectIdAndIdDescOnMergedActionForRemoval < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_events_on_project_id_and_id_desc_on_merged_action'

  # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/415091

  def up
    prepare_async_index_removal :events, [:project_id, :id], order: { id: :desc },
      where: "action = 7", name: INDEX_NAME
  end

  def down
    unprepare_async_index :events, [:project_id, :id], order: { id: :desc },
      where: "action = 7", name: INDEX_NAME
  end
end