Commit 24fe6171 authored by Douwe Maan's avatar Douwe Maan Committed by Yorick Peterse

Merge branch 'issue_14632' into 'master'

Fix group visibility level migration in case all visibility levels are restricted

fixes #14632 

See merge request !4107
parent 284f1ea3
...@@ -7,7 +7,9 @@ class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration ...@@ -7,7 +7,9 @@ class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration
add_column :application_settings, :default_group_visibility, :integer add_column :application_settings, :default_group_visibility, :integer
# Unfortunately, this can't be a `default`, since we don't want the configuration specific # Unfortunately, this can't be a `default`, since we don't want the configuration specific
# `allowed_visibility_level` to end up in schema.rb # `allowed_visibility_level` to end up in schema.rb
execute("UPDATE application_settings SET default_group_visibility = #{allowed_visibility_level}")
visibility_level = allowed_visibility_level || Gitlab::VisibilityLevel::PRIVATE
execute("UPDATE application_settings SET default_group_visibility = #{visibility_level}")
end end
def down def down
......
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