From 96813a5e508a54257ef03be613a704f1f71af53d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 21 Oct 2023 00:25:50 -0400 Subject: Added quotes database --- db/migrate/20231021020306_create_quotes.rb | 14 ++++++++++++++ db/schema.rb | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20231021020306_create_quotes.rb (limited to 'db') diff --git a/db/migrate/20231021020306_create_quotes.rb b/db/migrate/20231021020306_create_quotes.rb new file mode 100644 index 0000000..60424e5 --- /dev/null +++ b/db/migrate/20231021020306_create_quotes.rb @@ -0,0 +1,14 @@ +class CreateQuotes < ActiveRecord::Migration[7.0] + def change + create_table :quotes do |t| + t.text :content, null: false + t.string :state, null: false + t.string :submitter + t.text :notes, null: false + t.integer :upvotes, null: false, default: 0 + t.integer :downvotes, null: false, default: 0 + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index f8a8c49..541f1c1 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: 2023_10_20_195330) do +ActiveRecord::Schema[7.0].define(version: 2023_10_21_020306) do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false @@ -324,6 +324,17 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_20_195330) do t.index ["world_ribbon_id"], name: "index_pokeviewer_trainers_on_world_ribbon_id" end + create_table "quotes", force: :cascade do |t| + t.text "content", null: false + t.string "state", null: false + t.string "submitter" + t.text "notes", null: false + t.integer "upvotes", default: 0, null: false + t.integer "downvotes", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "records", force: :cascade do |t| t.text "description" t.string "recordable_type", limit: 191 -- cgit 1.4.1