summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-03-01 12:22:29 -0300
committerFelipe Artur <felipefac@gmail.com>2016-03-10 10:38:36 -0300
commitf2a9ee258e0ee3a6fe0cb614e4b73c56dcd7339d (patch)
tree84e668890ee51355f7ac9275012fbee3e295f5c4 /db
parent60ddd5ef34686e1ea9edc82a6915a9e4738bee50 (diff)
downloadgitlab-ce-f2a9ee258e0ee3a6fe0cb614e4b73c56dcd7339d.tar.gz
Add permission level to groups
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160301124843_add_visibility_level_to_groups.rb9
-rw-r--r--db/schema.rb10
2 files changed, 14 insertions, 5 deletions
diff --git a/db/migrate/20160301124843_add_visibility_level_to_groups.rb b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
new file mode 100644
index 00000000000..b0afe795f42
--- /dev/null
+++ b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
@@ -0,0 +1,9 @@
+class AddVisibilityLevelToGroups < ActiveRecord::Migration
+ def change
+ #All groups will be private when created
+ add_column :namespaces, :visibility_level, :integer, null: false, default: 0
+
+ #Set all existing groups to public
+ Group.update_all(visibility_level: 20)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a74b86d8e2f..d0e3bb769d2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,8 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160309140734) do
-
+ActiveRecord::Schema.define(version: 20160305220806) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -568,14 +567,15 @@ ActiveRecord::Schema.define(version: 20160309140734) do
add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree
create_table "namespaces", force: :cascade do |t|
- t.string "name", null: false
- t.string "path", null: false
+ t.string "name", null: false
+ t.string "path", null: false
t.integer "owner_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type"
- t.string "description", default: "", null: false
+ t.string "description", default: "", null: false
t.string "avatar"
+ t.integer "visibility_level", default: 0, null: false
end
add_index "namespaces", ["created_at", "id"], name: "index_namespaces_on_created_at_and_id", using: :btree