diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20231012190529_create_comments.rb | 15 | ||||
| -rw-r--r-- | db/schema.rb | 16 |
2 files changed, 30 insertions, 1 deletions
| 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 @@ | |||
| 1 | class CreateComments < ActiveRecord::Migration[7.0] | ||
| 2 | def change | ||
| 3 | create_table :comments do |t| | ||
| 4 | t.references :blog, null: false, foreign_key: true | ||
| 5 | t.string :username | ||
| 6 | t.string :email | ||
| 7 | t.string :website | ||
| 8 | t.text :body | ||
| 9 | t.string :status | ||
| 10 | t.datetime :published_at | ||
| 11 | |||
| 12 | t.timestamps | ||
| 13 | end | ||
| 14 | end | ||
| 15 | 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 @@ | |||
| 10 | # | 10 | # |
| 11 | # It's strongly recommended that you check this file into your version control system. | 11 | # It's strongly recommended that you check this file into your version control system. |
| 12 | 12 | ||
| 13 | ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do | 13 | ActiveRecord::Schema[7.0].define(version: 2023_10_12_190529) do |
| 14 | create_table "audits", force: :cascade do |t| | 14 | create_table "audits", force: :cascade do |t| |
| 15 | t.integer "auditable_id" | 15 | t.integer "auditable_id" |
| 16 | t.string "auditable_type" | 16 | t.string "auditable_type" |
| @@ -56,6 +56,19 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do | |||
| 56 | t.index ["type"], name: "index_ckeditor_assets_on_type" | 56 | t.index ["type"], name: "index_ckeditor_assets_on_type" |
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | create_table "comments", force: :cascade do |t| | ||
| 60 | t.integer "blog_id", null: false | ||
| 61 | t.string "username" | ||
| 62 | t.string "email" | ||
| 63 | t.string "website" | ||
| 64 | t.text "body" | ||
| 65 | t.string "status" | ||
| 66 | t.datetime "published_at" | ||
| 67 | t.datetime "created_at", null: false | ||
| 68 | t.datetime "updated_at", null: false | ||
| 69 | t.index ["blog_id"], name: "index_comments_on_blog_id" | ||
| 70 | end | ||
| 71 | |||
| 59 | create_table "games", force: :cascade do |t| | 72 | create_table "games", force: :cascade do |t| |
| 60 | t.string "title" | 73 | t.string "title" |
| 61 | t.string "status" | 74 | t.string "status" |
| @@ -345,6 +358,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_10_175109) do | |||
| 345 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true | 358 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true |
| 346 | end | 359 | end |
| 347 | 360 | ||
| 361 | add_foreign_key "comments", "blogs" | ||
| 348 | add_foreign_key "pokeviewer_items", "pokeviewer_moves", column: "move_id" | 362 | add_foreign_key "pokeviewer_items", "pokeviewer_moves", column: "move_id" |
| 349 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_species", column: "species_id" | 363 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_species", column: "species_id" |
| 350 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id" | 364 | add_foreign_key "pokeviewer_pokedex_entries", "pokeviewer_trainers", column: "trainer_id" |
