From 61a7b582e435fc213f9454e2d576c79c142b4266 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 13 Dec 2014 19:30:10 +0100 Subject: [PATCH] created notification model --- app/models/notification.rb | 2 ++ db/migrate/20141213182609_create_notifications.rb | 12 ++++++++++++ db/schema.rb | 11 ++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 app/models/notification.rb create mode 100644 db/migrate/20141213182609_create_notifications.rb diff --git a/app/models/notification.rb b/app/models/notification.rb new file mode 100644 index 00000000..b4b4b8f1 --- /dev/null +++ b/app/models/notification.rb @@ -0,0 +1,2 @@ +class Notification < ActiveRecord::Base +end diff --git a/db/migrate/20141213182609_create_notifications.rb b/db/migrate/20141213182609_create_notifications.rb new file mode 100644 index 00000000..160261a3 --- /dev/null +++ b/db/migrate/20141213182609_create_notifications.rb @@ -0,0 +1,12 @@ +class CreateNotifications < ActiveRecord::Migration + def change + create_table :notifications do |t| + t.string :target_type + t.integer :target_id + t.integer :recipient_id + t.boolean :new + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 2933058f..472c55c1 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: 20141212193625) do +ActiveRecord::Schema.define(version: 20141213182609) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -46,6 +46,15 @@ ActiveRecord::Schema.define(version: 20141212193625) do t.datetime "updated_at" end + create_table "notifications", force: true do |t| + t.string "target_type" + t.integer "target_id" + t.integer "recipient_id" + t.boolean "new" + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "questions", force: true do |t| t.string "content" t.boolean "author_is_anonymous"