From 9c022576fa053fd32aaebc7acb2bb44884a623d7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Sep 2017 19:01:56 -0400 Subject: Added hold items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An items model was created, but the seed only contains items that can be held, which excludes key items and HMs. Berry Juice, while unobtainable, is still included. The item model contains three description fields: one for Ruby/Sapphire, one for FireRed/LeafGreen, and one for Emerald. This is because the descriptions for items are different between the games. In a lot of cases, the Emerald description is the same as the Ruby/Sapphire one, so in those cases, the Emerald description is nil. The purpose of having the different descriptions is so that when a Pokémon holds an item, the website can display the description that is accurate to the game that that Pokémon is currently in. In order to fully support TMs, the move model was improved to additionally contain type and also the three description fields which operate similarly to those of the item model. For TMs, the description fields on the item are usually nil. However, some TMs in Ruby/Sapphire, as well as Emerald, have different descriptions than the moves that they correspond with. In these cases, those descriptions are in the item model, and override the move descriptions when the move is looked at as a TM. --- test/dummy/db/schema.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'test/dummy') diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 9530010..84e15a3 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/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: 20170930021856) do +ActiveRecord::Schema.define(version: 20170930213633) do create_table "pokeviewer_boxes", force: :cascade do |t| t.integer "trainer_id", null: false @@ -28,6 +28,18 @@ ActiveRecord::Schema.define(version: 20170930021856) do t.datetime "updated_at", null: false end + create_table "pokeviewer_items", force: :cascade do |t| + t.string "name", null: false + t.boolean "tm", default: false, null: false + t.integer "move_id" + t.string "rs_description" + t.string "frlg_description" + t.string "emerald_description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["move_id"], name: "index_pokeviewer_items_on_move_id" + end + create_table "pokeviewer_locations", force: :cascade do |t| t.string "name", null: false t.datetime "created_at", null: false @@ -39,6 +51,10 @@ ActiveRecord::Schema.define(version: 20170930021856) do t.integer "pp", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "move_type", null: false + t.string "rs_description", null: false + t.string "frlg_description", null: false + t.string "emerald_description" t.index ["name"], name: "index_pokeviewer_moves_on_name", unique: true end @@ -86,7 +102,7 @@ ActiveRecord::Schema.define(version: 20170930021856) do t.integer "smartness", null: false t.integer "toughness", null: false t.integer "sheen", null: false - t.integer "hold_item" + t.integer "item_id" t.integer "move_1_id", null: false t.integer "move_2_id" t.integer "move_3_id" -- cgit 1.4.1