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

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

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

  INDEX_NAME = "index_vulnerability_occurrences_on_uuid_1"

  def up
    add_concurrent_index(
      :vulnerability_occurrences,
      :uuid_convert_string_to_uuid,
      unique: true,
      name: INDEX_NAME
    )
  end

  def down
    remove_concurrent_index_by_name(
      :vulnerability_occurrences,
      INDEX_NAME
    )
  end
end