diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-02-16 09:03:55 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-02-16 09:03:55 +0200 |
commit | 1c62ec09b0fe8d51e9b375714c560eded1b35d51 (patch) | |
tree | fbca0d0d05935544e3bdf7ef77036d6fbdd30346 /db | |
parent | dac7c44ab357d703381c2beafd2e04996794fa45 (diff) | |
download | gitlab-ce-1c62ec09b0fe8d51e9b375714c560eded1b35d51.tar.gz |
4 roles permission system
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20120216085842_move_to_roles_permissions.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 15 |
2 files changed, 19 insertions, 14 deletions
diff --git a/db/migrate/20120216085842_move_to_roles_permissions.rb b/db/migrate/20120216085842_move_to_roles_permissions.rb new file mode 100644 index 00000000000..21679f11d88 --- /dev/null +++ b/db/migrate/20120216085842_move_to_roles_permissions.rb @@ -0,0 +1,18 @@ +class MoveToRolesPermissions < ActiveRecord::Migration + def up + repo_n = 0 + repo_r = 1 + repo_rw = 2 + project_rwa = 3 + + UsersProject.update_all ["project_access = ?", UsersProject::MASTER], ["project_access = ?", project_rwa] + UsersProject.update_all ["project_access = ?", UsersProject::DEVELOPER], ["repo_access = ?", repo_rw] + UsersProject.update_all ["project_access = ?", UsersProject::REPORTER], ["repo_access = ?", repo_r] + UsersProject.update_all ["project_access = ?", UsersProject::GUEST], ["repo_access = ?", repo_n] + + remove_column :users_projects, :repo_access + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index f7006c4c9c2..0ec8cfafc50 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,19 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120215182305) do - - create_table "features", :force => true do |t| - t.string "name" - t.string "branch_name" - t.integer "assignee_id" - t.integer "author_id" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "version" - t.integer "status", :default => 0, :null => false - end +ActiveRecord::Schema.define(:version => 20120216085842) do create_table "issues", :force => true do |t| t.string "title" @@ -160,7 +148,6 @@ ActiveRecord::Schema.define(:version => 20120215182305) do t.integer "project_id", :null => false t.datetime "created_at" t.datetime "updated_at" - t.integer "repo_access", :default => 0, :null => false t.integer "project_access", :default => 0, :null => false end |