From 835af696703484208882a70cc5dd47c5838ecf58 Mon Sep 17 00:00:00 2001
From: Star Rauchenberger <fefferburbia@gmail.com>
Date: Thu, 12 Oct 2023 17:10:34 -0400
Subject: Added blog post commenting

---
 db/migrate/20231012190529_create_comments.rb | 15 +++++++++++++++
 db/schema.rb                                 | 16 +++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 db/migrate/20231012190529_create_comments.rb

(limited to 'db')

diff --git a/db/migrate/20231012190529_create_comments.rb b/db/migrate/20231012190529_create_comments.rb
new file mode 100644
index 0000000..3073dd5
--- /dev/null
+++ b/db/migrate/20231012190529_create_comments.rb
@@ -0,0 +1,15 @@
+class CreateComments < ActiveRecord::Migration[7.0]
+  def change
+    create_table :comments do |t|
+      t.references :blog, null: false, foreign_key: true
+      t.string :username
+      t.string :email
+      t.string :website
+      t.text :body
+      t.string :status
+      t.datetime :published_at
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 5b61408..2a9b1df 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do
+ActiveRecord::Schema[7.0].define(version: 2023_10_12_190529) do
   create_table "audits", force: :cascade do |t|
     t.integer "auditable_id"
     t.string "auditable_type"
@@ -56,6 +56,19 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do
     t.index ["type"], name: "index_ckeditor_assets_on_type"
   end
 
+  create_table "comments", force: :cascade do |t|
+    t.integer "blog_id", null: false
+    t.string "username"
+    t.string "email"
+    t.string "website"
+    t.text "body"
+    t.string "status"
+    t.datetime "published_at"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["blog_id"], name: "index_comments_on_blog_id"
+  end
+
   create_table "games", force: :cascade do |t|
     t.string "title"
     t.string "status"
@@ -345,6 +358,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do
     t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
   end
 
+  add_foreign_key "comments", "blogs"
   add_foreign_key "pokeviewer_items", "pokeviewer_moves", column: "move_id"
   add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_species", column: "species_id"
   add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id"
-- 
cgit 1.4.1