diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-05-07 15:38:43 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-05-07 15:38:43 +0800 |
commit | 24eff5e08332a0bf301a85630be171332174cc1f (patch) | |
tree | 16f89210b0be32d13c500e1afb96ba2488d90018 /lib | |
parent | bd73925b858cbb7229b3d335da0e5d0023f57caf (diff) | |
download | gitlab-ce-24eff5e08332a0bf301a85630be171332174cc1f.tar.gz |
Add remove_foreign_key_if_existsce-11099-removing-the-project-that-holds-the-insights-configuration-raises-an-error
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 6 |
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 |