From 4c96893a114059dc4e748307c6d046ec1faa778f Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 2 Jun 2021 22:15:02 -0400 Subject: Magiculture --- db/migrate/20210602225942_create_hearth_plantings.rb | 10 ++++++++++ db/schema.rb | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210602225942_create_hearth_plantings.rb (limited to 'db') diff --git a/db/migrate/20210602225942_create_hearth_plantings.rb b/db/migrate/20210602225942_create_hearth_plantings.rb new file mode 100644 index 0000000..b5d0adb --- /dev/null +++ b/db/migrate/20210602225942_create_hearth_plantings.rb @@ -0,0 +1,10 @@ +class CreateHearthPlantings < ActiveRecord::Migration[6.1] + def change + create_table :hearth_plantings do |t| + t.references :hearth, null: false, foreign_key: true + t.references :item, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 2a0b30a..9e20579 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.define(version: 2021_05_31_192205) do +ActiveRecord::Schema.define(version: 2021_06_02_225942) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -140,6 +140,15 @@ ActiveRecord::Schema.define(version: 2021_05_31_192205) do t.index ["gid"], name: "index_hearth_amenities_on_gid" end + create_table "hearth_plantings", force: :cascade do |t| + t.bigint "hearth_id", null: false + t.bigint "item_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["hearth_id"], name: "index_hearth_plantings_on_hearth_id" + t.index ["item_id"], name: "index_hearth_plantings_on_item_id" + end + create_table "hearths", force: :cascade do |t| t.bigint "character_id", null: false t.datetime "created_at", precision: 6, null: false @@ -265,6 +274,8 @@ ActiveRecord::Schema.define(version: 2021_05_31_192205) do add_foreign_key "chat_messages", "chat_rooms" add_foreign_key "equipment", "characters" add_foreign_key "equipment", "items" + add_foreign_key "hearth_plantings", "hearths" + add_foreign_key "hearth_plantings", "items" add_foreign_key "hearths", "characters" add_foreign_key "learned_activities", "activities" add_foreign_key "learned_activities", "characters" -- cgit v1.2.3