summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-03-22 00:23:58 +0100
committerDouwe Maan <douwe@selenight.nl>2016-03-22 00:23:58 +0100
commit503244eb9638bb141e3883d40281d7188fe8c02e (patch)
tree8d903905022ad537aa46aee7cd0b7f8f239aa23e /db
parent31266c5be4748f57a7d56bbcc6f06d570cbf5356 (diff)
downloadgitlab-ce-503244eb9638bb141e3883d40281d7188fe8c02e.tar.gz
Fix specsissue_12658
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160301124843_add_visibility_level_to_groups.rb1
-rw-r--r--db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/db/migrate/20160301124843_add_visibility_level_to_groups.rb b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
index 8121a0c6f90..d1b921bb208 100644
--- a/db/migrate/20160301124843_add_visibility_level_to_groups.rb
+++ b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
@@ -17,7 +17,6 @@ class AddVisibilityLevelToGroups < ActiveRecord::Migration
private
def allowed_visibility_level
- return 20
application_settings = select_one("SELECT restricted_visibility_levels FROM application_settings ORDER BY id DESC LIMIT 1")
if application_settings
restricted_visibility_levels = YAML.safe_load(application_settings["restricted_visibility_levels"]) rescue nil
diff --git a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
index 37179926d42..75de5f70fa2 100644
--- a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
+++ b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
@@ -5,6 +5,8 @@
class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration
def up
add_column :application_settings, :default_group_visibility, :integer
+ # Unfortunately, this can't be a `default`, since we don't want the configuration specific
+ # `allowed_visibility_level` to end up in schema.rb
execute("UPDATE application_settings SET default_group_visibility = #{allowed_visibility_level}")
end