summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-05-07 20:24:22 +0000
committerRobert Speicher <rspeicher@gmail.com>2019-05-07 20:24:22 +0000
commit7b7416d9862f52fe0f0a304eeeaaa4b8d65bc8eb (patch)
treeaaf22dd25d7e810bc754730e509f74e11c81f082
parentaa83a82349de91b57a69939a75b4077d37b6d65c (diff)
parent24eff5e08332a0bf301a85630be171332174cc1f (diff)
downloadgitlab-ce-7b7416d9862f52fe0f0a304eeeaaa4b8d65bc8eb.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
-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