debian-mirror-gitlab/db/post_migrate/20220524081955_remove_notes_null_discussion_id_temp_index.rb
2022-07-23 20:15:48 +02:00

16 lines
384 B
Ruby

# frozen_string_literal: true
class RemoveNotesNullDiscussionIdTempIndex < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'tmp_index_notes_on_id_where_discussion_id_is_null'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name :notes, INDEX_NAME
end
def down
add_concurrent_index :notes, :id, where: 'discussion_id IS NULL', name: INDEX_NAME
end
end