summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-05-07 15:38:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-05-07 15:38:43 +0800
commit24eff5e08332a0bf301a85630be171332174cc1f (patch)
tree16f89210b0be32d13c500e1afb96ba2488d90018
parentbd73925b858cbb7229b3d335da0e5d0023f57caf (diff)
downloadgitlab-ce-ce-11099-removing-the-project-that-holds-the-insights-configuration-raises-an-error.tar.gz
-rw-r--r--lib/gitlab/database/migration_helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index 7f5eb1188fc..cc61bb7fa02 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -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