diff options
author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-14 17:17:59 +0400 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-18 00:47:16 +0400 |
commit | 9b5c7a4d6026265cfeaeac9ad5101f8826515dbe (patch) | |
tree | 18d795d222563b9c672aff1121b11022a32016b7 /db/migrate | |
parent | ecd771ccdfe54b08ea7f80f64667228b7938238d (diff) |
Add star count, view logic, more tests.
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20140625115202_create_users_star_projects.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20140625115202_create_users_star_projects.rb b/db/migrate/20140625115202_create_users_star_projects.rb index 70475535d54..412f0f6f34b 100644 --- a/db/migrate/20140625115202_create_users_star_projects.rb +++ b/db/migrate/20140625115202_create_users_star_projects.rb @@ -5,9 +5,11 @@ class CreateUsersStarProjects < ActiveRecord::Migration t.integer :user_id, null: false t.timestamps end - add_index :users_star_projects, :user_id add_index :users_star_projects, :project_id add_index :users_star_projects, [:user_id, :project_id], unique: true + + add_column :projects, :star_count, :integer, default: 0, null: false + add_index :projects, :star_count, using: :btree end end |