summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-05-07 20:24:22 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-06-03 13:00:00 +0000
commit5040b7259b3f422b596fe2f7b040c9bb3506a19a (patch)
treeade658a0a3eaefa9e7d2f58852827e82f40593d2
parent77cec14e7eb30686812a36d8109ef7a64380fdad (diff)
downloadgitlab-ce-5040b7259b3f422b596fe2f7b040c9bb3506a19a.tar.gz
Merge branch 'ce-11099-removing-the-project-that-holds-the-insights-configuration-raises-an-error' into 'master'
Add remove_foreign_key_if_exists See merge request gitlab-org/gitlab-ce!28172 (cherry picked from commit 7b7416d9862f52fe0f0a304eeeaaa4b8d65bc8eb) 24eff5e0 Add remove_foreign_key_if_exists
-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