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

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

class AddIssuesIncidentTypeTempIndexAsyncDotCom < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id_only_incidents'
  INCIDENT_ENUM_VALUE = 1

  # TODO: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117728
  def up
    prepare_async_index :issues, [:issue_type, :id], name: INDEX_NAME, where: "issue_type = #{INCIDENT_ENUM_VALUE}"
  end

  def down
    unprepare_async_index :issues, [:issue_type, :id], name: INDEX_NAME
  end
end