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

16 lines
381 B
Ruby

# frozen_string_literal: true
class CreateConfidentialNotesIndexSynchronously < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'index_notes_on_confidential'
disable_ddl_transaction!
def up
add_concurrent_index :notes, :confidential, where: 'confidential = true', name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :notes, name: INDEX_NAME
end
end