diff options
author | Valera Sizov <vsv2711@gmail.com> | 2011-10-09 11:15:01 -0700 |
---|---|---|
committer | Valera Sizov <vsv2711@gmail.com> | 2011-10-09 11:15:01 -0700 |
commit | 67f0c62d0737ceeeb1babc953fbab41438e8d4f2 (patch) | |
tree | fe1cb1e267375e0c24029bd3f22cc82447f11464 /db | |
parent | 9840102651ac84d2eb7824113a544bf4992e0398 (diff) | |
download | gitlab-ce-67f0c62d0737ceeeb1babc953fbab41438e8d4f2.tar.gz |
Issue #83 - Project limit
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/001_admin.rb | 1 | ||||
-rw-r--r-- | db/fixtures/production/001_admin.rb | 1 | ||||
-rw-r--r-- | db/migrate/20111009110913_add_projects_limit_to_user.rb | 5 | ||||
-rw-r--r-- | db/migrate/20111009111204_remove_allow_create_repo_from_user.rb | 9 | ||||
-rw-r--r-- | db/schema.rb | 4 |
5 files changed, 18 insertions, 2 deletions
diff --git a/db/fixtures/development/001_admin.rb b/db/fixtures/development/001_admin.rb index 5020eccbca4..9c5a6da09e0 100644 --- a/db/fixtures/development/001_admin.rb +++ b/db/fixtures/development/001_admin.rb @@ -6,5 +6,6 @@ admin = User.create( :password_confirmation => "5iveL!fe" ) +admin.projects_limit = 10000 admin.admin = true admin.save! diff --git a/db/fixtures/production/001_admin.rb b/db/fixtures/production/001_admin.rb index a50a693632b..94d1abe87ce 100644 --- a/db/fixtures/production/001_admin.rb +++ b/db/fixtures/production/001_admin.rb @@ -5,5 +5,6 @@ admin = User.create( :password_confirmation => "5iveL!fe" ) +admin.projects_limit = 10000 admin.admin = true admin.save! diff --git a/db/migrate/20111009110913_add_projects_limit_to_user.rb b/db/migrate/20111009110913_add_projects_limit_to_user.rb new file mode 100644 index 00000000000..8eb8382b515 --- /dev/null +++ b/db/migrate/20111009110913_add_projects_limit_to_user.rb @@ -0,0 +1,5 @@ +class AddProjectsLimitToUser < ActiveRecord::Migration + def change + add_column :users, :projects_limit, :integer, :default => 10 + end +end diff --git a/db/migrate/20111009111204_remove_allow_create_repo_from_user.rb b/db/migrate/20111009111204_remove_allow_create_repo_from_user.rb new file mode 100644 index 00000000000..61452006397 --- /dev/null +++ b/db/migrate/20111009111204_remove_allow_create_repo_from_user.rb @@ -0,0 +1,9 @@ +class RemoveAllowCreateRepoFromUser < ActiveRecord::Migration + def up + remove_column :users, :allowed_create_repo + end + + def down + add_column :users, :allowed_create_repo, :boolean, :default => true, :null => false + end +end diff --git a/db/schema.rb b/db/schema.rb index ad4b28875bc..ed5816ca329 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111009101738) do +ActiveRecord::Schema.define(:version => 20111009111204) do create_table "issues", :force => true do |t| t.string "title" @@ -70,7 +70,7 @@ ActiveRecord::Schema.define(:version => 20111009101738) do t.datetime "updated_at" t.string "name" t.boolean "admin", :default => false, :null => false - t.boolean "allowed_create_repo", :default => true, :null => false + t.integer "projects_limit" end add_index "users", ["email"], :name => "index_users_on_email", :unique => true |