diff options
author | Fabio Papa <fabtheman@gmail.com> | 2019-07-01 13:41:32 -0700 |
---|---|---|
committer | Fabio Papa <fabtheman@gmail.com> | 2019-07-19 11:55:49 -0700 |
commit | d4c53e1799d4967c20ac771f6628416183985ef4 (patch) | |
tree | 0bc24f66e12422be4e76ba92bc18fa61a81499ee /db | |
parent | b36d78eabc53bb6a457c45b67a65276c85bf2b8a (diff) | |
download | gitlab-ce-d4c53e1799d4967c20ac771f6628416183985ef4.tar.gz |
Apply changes recomended by merge request coach
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 6 insertions, 11 deletions
diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb index 85ac89af46e..867ec3b7c91 100644 --- a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb +++ b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb @@ -7,18 +7,13 @@ class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1] disable_ddl_transaction! def up - unless column_exists?(:namespaces, :subgroup_creation_level) - add_column_with_default(:namespaces, - :subgroup_creation_level, - :integer, - default: 0) - change_column_default(:namespaces, :subgroup_creation_level, 1) - end + add_column(:namespaces, :subgroup_creation_level, :integer) + change_column_default(:namespaces, + :subgroup_creation_level, + ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS) end def down - if column_exists?(:namespaces, :subgroup_creation_level) - remove_column(:namespaces, :subgroup_creation_level) - end + remove_column(:namespaces, :subgroup_creation_level) end end diff --git a/db/schema.rb b/db/schema.rb index 0f5770e4eb1..79cd1a3a797 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2119,7 +2119,7 @@ ActiveRecord::Schema.define(version: 2019_07_15_114644) do t.string "ldap_sync_status", default: "ready", null: false t.boolean "membership_lock", default: false t.integer "last_ci_minutes_usage_notification_level" - t.integer "subgroup_creation_level", default: 0, null: false + t.integer "subgroup_creation_level", default: 1 t.index ["created_at"], name: "index_namespaces_on_created_at", using: :btree t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)", using: :btree t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id", using: :btree |