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

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

class AddIndexToNamespacesOrganizationId < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_namespaces_on_organization_id'
  TABLE = :namespaces

  disable_ddl_transaction!

  # This index was added on GitLab SaaS in
  # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120822

  def up
    add_concurrent_index TABLE, :organization_id, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name TABLE, INDEX_NAME
  end
end