Add remove_foreign_key_if_exists

This commit is contained in:
Lin Jen-Shin 2019-05-07 15:38:43 +08:00
parent bd73925b85
commit 24eff5e083

View file

@ -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