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

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

class DropWrongIndexOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  INDEX_NAME = 'tmp_idx_vulns_on_converted_uuid'

  def up
    # We do not want to drop this from Gitlab.com
    # because it was created correctly there
    return if Gitlab.com? && !Gitlab.dev_or_test_env?

    remove_concurrent_index_by_name(
      :vulnerability_occurrences,
      INDEX_NAME
    )
  end

  def down
    # no-op
  end
end