From e2bf712558de33cdae8a6b71877a4ed815a3e481 Mon Sep 17 00:00:00 2001 From: alan snape Date: Wed, 28 Dec 2016 06:22:55 +0000 Subject: [PATCH] add user_id to comments --- db/migrate/20161228062119_add_user_id_to_comments.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20161228062119_add_user_id_to_comments.rb diff --git a/db/migrate/20161228062119_add_user_id_to_comments.rb b/db/migrate/20161228062119_add_user_id_to_comments.rb new file mode 100644 index 0000000..a719762 --- /dev/null +++ b/db/migrate/20161228062119_add_user_id_to_comments.rb @@ -0,0 +1,5 @@ +class AddUserIdToComments < ActiveRecord::Migration + def change + add_column :comments, :user_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 4c8962f..b9e724c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,13 +11,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161228052102) do +ActiveRecord::Schema.define(version: 20161228062119) do create_table "comments", force: :cascade do |t| t.text "content" t.integer "mission_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "user_id" end add_index "comments", ["mission_id"], name: "index_comments_on_mission_id"