summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-17 16:45:04 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-17 16:45:04 +0000
commit9162e34bb078be9f4fb35b7e43f89c926dc3bcd8 (patch)
tree7d93fd0f30f83fb2fb2e502a4891aa2f1571fbc7 /db
parent409097bd7e0f5857cf0bc5462bd47484980ec787 (diff)
parent22fcb2f418ed6a2c7e68c0cd3ec2d414510ad4ec (diff)
downloadgitlab-ce-9162e34bb078be9f4fb35b7e43f89c926dc3bcd8.tar.gz
Merge branch 'issue_subscription' into 'master'
Subscription to issue/mr Fixes #1911 and #1909 ![joxi_screenshot_1426601822159](https://dev.gitlab.org/gitlab/gitlabhq/uploads/53021bc5783271322ab2dfba7598eaa3/joxi_screenshot_1426601822159.png) ![joxi_screenshot_1426601836423](https://dev.gitlab.org/gitlab/gitlabhq/uploads/244ff360fbd6f30980f8dad699400814/joxi_screenshot_1426601836423.png) See merge request !1702
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20150313012111_create_subscriptions_table.rb16
-rw-r--r--db/schema.rb15
2 files changed, 29 insertions, 2 deletions
diff --git a/db/migrate/20150313012111_create_subscriptions_table.rb b/db/migrate/20150313012111_create_subscriptions_table.rb
new file mode 100644
index 00000000000..a1d4d9dedc5
--- /dev/null
+++ b/db/migrate/20150313012111_create_subscriptions_table.rb
@@ -0,0 +1,16 @@
+class CreateSubscriptionsTable < ActiveRecord::Migration
+ def change
+ create_table :subscriptions do |t|
+ t.integer :user_id
+ t.references :subscribable, polymorphic: true
+ t.boolean :subscribed
+
+ t.timestamps
+ end
+
+ add_index :subscriptions,
+ [:subscribable_id, :subscribable_type, :user_id],
+ unique: true,
+ name: 'subscriptions_user_id_and_ref_fields'
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3dcc43803b9..e7dccbad4f9 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: 20150306023112) do
+ActiveRecord::Schema.define(version: 20150313012111) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -335,12 +335,12 @@ ActiveRecord::Schema.define(version: 20150306023112) do
t.string "import_url"
t.integer "visibility_level", default: 0, null: false
t.boolean "archived", default: false, null: false
+ t.string "avatar"
t.string "import_status"
t.float "repository_size", default: 0.0
t.integer "star_count", default: 0, null: false
t.string "import_type"
t.string "import_source"
- t.string "avatar"
end
add_index "projects", ["created_at", "id"], name: "index_projects_on_created_at_and_id", using: :btree
@@ -398,6 +398,17 @@ ActiveRecord::Schema.define(version: 20150306023112) do
add_index "snippets", ["project_id"], name: "index_snippets_on_project_id", using: :btree
add_index "snippets", ["visibility_level"], name: "index_snippets_on_visibility_level", using: :btree
+ create_table "subscriptions", force: true do |t|
+ t.integer "user_id"
+ t.integer "subscribable_id"
+ t.string "subscribable_type"
+ t.boolean "subscribed"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], name: "subscriptions_user_id_and_ref_fields", unique: true, using: :btree
+
create_table "taggings", force: true do |t|
t.integer "tag_id"
t.integer "taggable_id"