blob: 0cc76d129efac1c54ab09ba9aea824f93923e899 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# frozen_string_literal: true
class RemoveNamespacesUsersManagingGroupIdFk < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:users, :namespaces, name: "fk_a4b8fefe3e")
with_lock_retries do
remove_foreign_key_if_exists(:users, :namespaces,
name: "fk_a4b8fefe3e", reverse_lock_order: true)
end
end
def down
add_concurrent_foreign_key(:users, :namespaces,
name: "fk_a4b8fefe3e", column: :managing_group_id,
target_column: :id, on_delete: :nullify)
end
end
|