debian-mirror-gitlab/db/migrate/20220920022404_remove_temp_index_null_project_namespace_id.rb
2022-11-25 23:54:43 +05:30

15 lines
388 B
Ruby

# frozen_string_literal: true
class RemoveTempIndexNullProjectNamespaceId < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'tmp_index_for_null_project_namespace_id'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name :projects, INDEX_NAME
end
def down
add_concurrent_index :projects, :id, name: INDEX_NAME, where: 'project_namespace_id IS NULL'
end
end