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

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

class AddSyncTmpPartialIndexOnVulnerabilityReportTypes < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99'

  disable_ddl_transaction!

  def up
    # Temporary index to be removed in 15.11 https://gitlab.com/gitlab-org/gitlab/-/issues/393052
    add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
  end
end