Add remove_foreign_key_if_exists
This commit is contained in:
parent
bd73925b85
commit
24eff5e083
1 changed files with 6 additions and 0 deletions
|
@ -905,6 +905,12 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
def remove_foreign_key_if_exists(*args)
|
||||
if foreign_key_exists?(*args)
|
||||
remove_foreign_key(*args)
|
||||
end
|
||||
end
|
||||
|
||||
def remove_foreign_key_without_error(*args)
|
||||
remove_foreign_key(*args)
|
||||
rescue ArgumentError
|
||||
|
|
Loading…
Reference in a new issue