diff options
author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-14 15:17:59 +0200 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-07-17 22:47:16 +0200 |
commit | 9b5c7a4d6026265cfeaeac9ad5101f8826515dbe (patch) | |
tree | 18d795d222563b9c672aff1121b11022a32016b7 /db | |
parent | ecd771ccdfe54b08ea7f80f64667228b7938238d (diff) | |
download | gitlab-ce-9b5c7a4d6026265cfeaeac9ad5101f8826515dbe.tar.gz |
Add star count, view logic, more tests.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20140625115202_create_users_star_projects.rb | 4 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 5 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 diff --git a/db/schema.rb b/db/schema.rb index fd0f15a7fa6..e4dcdf5bea2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -224,11 +224,13 @@ ActiveRecord::Schema.define(version: 20140625115202) do t.boolean "archived", default: false, null: false t.string "import_status" t.float "repository_size", default: 0.0 + t.integer "star_count", default: 0, null: false end add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree add_index "projects", ["last_activity_at"], name: "index_projects_on_last_activity_at", using: :btree add_index "projects", ["namespace_id"], name: "index_projects_on_namespace_id", using: :btree + add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree create_table "protected_branches", force: true do |t| t.integer "project_id", null: false |