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

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

class AddTemporaryIndexToCreateAccessLevels < Gitlab::Database::Migration[2.2]
  disable_ddl_transaction!
  milestone '16.6'

  INDEX_NAME = 'tmp_idx_protected_tag_create_access_levels_on_id_with_group'

  def up
    # Temporary index to be removed in 16.7 https://gitlab.com/gitlab-org/gitlab/-/issues/430843
    add_concurrent_index(
      :protected_tag_create_access_levels,
      %i[id],
      where: 'group_id IS NOT NULL',
      name: INDEX_NAME
    )
  end

  def down
    remove_concurrent_index_by_name(
      :protected_tag_create_access_levels,
      INDEX_NAME
    )
  end
end