summaryrefslogtreecommitdiff
path: root/db/migrate/20211020095357_add_group_traversal_id_index.rb
blob: e4739ff217eccb38ba51c0bc5870c2d4740d0bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddGroupTraversalIdIndex < Gitlab::Database::Migration[1.0]
  INDEX_NAME = 'index_namespaces_on_traversal_ids_for_groups'

  disable_ddl_transaction!

  def up
    add_concurrent_index :namespaces, :traversal_ids, using: :gin, where: "type='Group'", name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :namespaces, INDEX_NAME
  end
end