summaryrefslogtreecommitdiff
path: root/db/post_migrate/20221103084213_remove_tmp_index_members_on_id_where_namespace_id_null.rb
blob: 07908e697f5f8bbf121ca9491b0dbe1cfee63242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class RemoveTmpIndexMembersOnIdWhereNamespaceIdNull < Gitlab::Database::Migration[2.0]
  INDEX_NAME = 'tmp_index_members_on_id_where_namespace_id_null'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name :members, INDEX_NAME
  end

  def down
    add_concurrent_index :members, :id, name: INDEX_NAME, where: 'member_namespace_id IS NULL'
  end
end