Commit 3e2fa62b authored by Patrick Bair's avatar Patrick Bair

Merge branch 'fix-check-constraint-removal-for-has_external_wiki' into 'master'

Verify check constraint existence before removing

See merge request gitlab-org/gitlab!53267
parents 2937425b dda83994
...@@ -9,8 +9,10 @@ class RemoveHasExternalWikiConstraint < ActiveRecord::Migration[6.0] ...@@ -9,8 +9,10 @@ class RemoveHasExternalWikiConstraint < ActiveRecord::Migration[6.0]
def up def up
# This reverts the following migration: add_not_null_constraint :projects, :has_external_wiki, validate: false # This reverts the following migration: add_not_null_constraint :projects, :has_external_wiki, validate: false
if check_not_null_constraint_exists?(:projects, :has_external_wiki)
remove_not_null_constraint :projects, :has_external_wiki remove_not_null_constraint :projects, :has_external_wiki
end end
end
def down def down
# no-op # no-op
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment