summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-24 10:54:42 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-24 10:54:42 +0300
commite21ca9f8b140476f93eaa2c2a0d6bf96f28b6995 (patch)
treeecaa584f33ed4d5231d07d6dddc8675feb8f19ad /db
parent4a1e98e4b69800c0044110c1aff6cfdf972b57b6 (diff)
parente1d307bf4b88afa59d851918c29ffbb61b01e8c5 (diff)
downloadgitlab-ce-e21ca9f8b140476f93eaa2c2a0d6bf96f28b6995.tar.gz
Merge branch 'star' of https://github.com/cirosantilli/gitlabhq into cirosantilli-star
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: CHANGELOG
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140625115202_create_users_star_projects.rb15
-rw-r--r--db/schema.rb15
2 files changed, 29 insertions, 1 deletions
diff --git a/db/migrate/20140625115202_create_users_star_projects.rb b/db/migrate/20140625115202_create_users_star_projects.rb
new file mode 100644
index 00000000000..412f0f6f34b
--- /dev/null
+++ b/db/migrate/20140625115202_create_users_star_projects.rb
@@ -0,0 +1,15 @@
+class CreateUsersStarProjects < ActiveRecord::Migration
+ def change
+ create_table :users_star_projects do |t|
+ t.integer :project_id, null: false
+ 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 345b6fd3b68..e4dcdf5bea2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20140611135229) do
+ActiveRecord::Schema.define(version: 20140625115202) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -224,11 +224,13 @@ ActiveRecord::Schema.define(version: 20140611135229) 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
@@ -369,6 +371,17 @@ ActiveRecord::Schema.define(version: 20140611135229) do
add_index "users_projects", ["project_id"], name: "index_users_projects_on_project_id", using: :btree
add_index "users_projects", ["user_id"], name: "index_users_projects_on_user_id", using: :btree
+ create_table "users_star_projects", force: true do |t|
+ t.integer "project_id", null: false
+ t.integer "user_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "users_star_projects", ["project_id"], name: "index_users_star_projects_on_project_id", using: :btree
+ add_index "users_star_projects", ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true, using: :btree
+ add_index "users_star_projects", ["user_id"], name: "index_users_star_projects_on_user_id", using: :btree
+
create_table "web_hooks", force: true do |t|
t.string "url"
t.integer "project_id"