From 9d6d876c62408c69c654aab1a664f1294ec668b7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Oct 2017 13:49:03 -0400 Subject: Added pokeviewer --- .../20171015171142_add_pokeviewer_token_to_user.rb | 9 ++ ...171539_create_pokeviewer_trainers.pokeviewer.rb | 14 +++ ...5171540_create_pokeviewer_species.pokeviewer.rb | 12 +++ ...5171541_create_pokeviewer_pokemon.pokeviewer.rb | 32 ++++++ ...015171542_create_pokeviewer_moves.pokeviewer.rb | 13 +++ ...71543_create_pokeviewer_revisions.pokeviewer.rb | 52 ++++++++++ ...015171544_make_met_level_nullable.pokeviewer.rb | 6 ++ ...15171545_add_ot_gender_to_pokemon.pokeviewer.rb | 6 ++ ...71546_add_storage_info_to_pokemon.pokeviewer.rb | 7 ++ ...015171547_create_pokeviewer_boxes.pokeviewer.rb | 16 +++ ...71548_create_pokeviewer_locations.pokeviewer.rb | 10 ++ ...015171549_add_ribbons_to_revision.pokeviewer.rb | 25 +++++ ...50_create_pokeviewer_gift_ribbons.pokeviewer.rb | 10 ++ ...71551_add_gift_ribbons_to_trainer.pokeviewer.rb | 35 +++++++ ...015171552_create_pokeviewer_items.pokeviewer.rb | 17 ++++ ...add_description_and_type_to_moves.pokeviewer.rb | 15 +++ ...5171554_rename_revision_hold_item.pokeviewer.rb | 10 ++ ...71555_rename_pokemon_met_location.pokeviewer.rb | 31 ++++++ .../20171015171556_remove_boxes.pokeviewer.rb | 107 +++++++++++++++++++++ ...015171557_add_pokeball_to_pokemon.pokeviewer.rb | 10 ++ ...71558_create_pokeviewer_abilities.pokeviewer.rb | 13 +++ ...9_add_type_and_ability_to_species.pokeviewer.rb | 20 ++++ 22 files changed, 470 insertions(+) create mode 100644 db/migrate/20171015171142_add_pokeviewer_token_to_user.rb create mode 100644 db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb create mode 100644 db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb create mode 100644 db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb create mode 100644 db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb create mode 100644 db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb create mode 100644 db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb create mode 100644 db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb create mode 100644 db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb create mode 100644 db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb create mode 100644 db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb create mode 100644 db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb create mode 100644 db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb create mode 100644 db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb create mode 100644 db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb create mode 100644 db/migrate/20171015171556_remove_boxes.pokeviewer.rb create mode 100644 db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb create mode 100644 db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb create mode 100644 db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb (limited to 'db/migrate') diff --git a/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb b/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb new file mode 100644 index 0000000..2dc5143 --- /dev/null +++ b/db/migrate/20171015171142_add_pokeviewer_token_to_user.rb @@ -0,0 +1,9 @@ +class AddPokeviewerTokenToUser < ActiveRecord::Migration[5.1] + def change + change_table :users do |t| + t.string :pokeviewer_token, limit: 191 + end + + add_index :users, :pokeviewer_token, unique: true + end +end diff --git a/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb b/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb new file mode 100644 index 0000000..396bcea --- /dev/null +++ b/db/migrate/20171015171539_create_pokeviewer_trainers.pokeviewer.rb @@ -0,0 +1,14 @@ +# This migration comes from pokeviewer (originally 20170916225306) +class CreatePokeviewerTrainers < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_trainers do |t| + t.string :game, null: false + t.string :name, null: false, limit: 191 + t.integer :number, null: false + + t.timestamps + end + + add_index :pokeviewer_trainers, [:name, :number], unique: true + end +end diff --git a/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb b/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb new file mode 100644 index 0000000..d3e299f --- /dev/null +++ b/db/migrate/20171015171540_create_pokeviewer_species.pokeviewer.rb @@ -0,0 +1,12 @@ +# This migration comes from pokeviewer (originally 20170916232015) +class CreatePokeviewerSpecies < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_species do |t| + t.string :name, null: false, limit: 191 + + t.timestamps + end + + add_index :pokeviewer_species, :name, unique: true + end +end diff --git a/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb new file mode 100644 index 0000000..dd14d8c --- /dev/null +++ b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb @@ -0,0 +1,32 @@ +# This migration comes from pokeviewer (originally 20170916234251) +class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_pokemon do |t| + t.string :uuid, null: false, limit: 191 + t.references :species, null: false + t.references :trainer, null: true + t.string :key, null: true, limit: 191 + t.string :ot_name, null: false + t.integer :ot_number, null: false + t.string :met_type, null: false + t.string :met_location, null: true + t.integer :met_level, null: false + t.boolean :shiny, null: false, default: false + t.string :nature, null: false + t.string :gender, null: false + t.boolean :second_ability, null: false + t.string :unown_letter, null: true, limit: 1 + + t.timestamps + end + + add_index :pokeviewer_pokemon, :uuid, unique: true + add_index :pokeviewer_pokemon, :key, unique: true + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, + column: :species_id + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainers, + column: :trainer_id + end +end diff --git a/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb b/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb new file mode 100644 index 0000000..47fa68f --- /dev/null +++ b/db/migrate/20171015171542_create_pokeviewer_moves.pokeviewer.rb @@ -0,0 +1,13 @@ +# This migration comes from pokeviewer (originally 20170917011102) +class CreatePokeviewerMoves < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_moves do |t| + t.string :name, null: false, limit: 191 + t.integer :pp, null: false + + t.timestamps + end + + add_index :pokeviewer_moves, :name, unique: true + end +end diff --git a/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb b/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb new file mode 100644 index 0000000..c44c227 --- /dev/null +++ b/db/migrate/20171015171543_create_pokeviewer_revisions.pokeviewer.rb @@ -0,0 +1,52 @@ +# This migration comes from pokeviewer (originally 20170917011258) +class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revisions do |t| + t.references :pokemon, null: false + t.integer :sequential_id, null: false + t.string :nickname, null: false + t.integer :experience, null: false + t.integer :level, null: false + t.integer :hp, null: false + t.integer :attack, null: false + t.integer :defense, null: false + t.integer :special_attack, null: false + t.integer :special_defense, null: false + t.integer :speed, null: false + t.integer :coolness, null: false + t.integer :beauty, null: false + t.integer :cuteness, null: false + t.integer :smartness, null: false + t.integer :toughness, null: false + t.integer :sheen, null: false + t.integer :hold_item, null: true + t.references :move_1, null: false + t.references :move_2, null: true + t.references :move_3, null: true + t.references :move_4, null: true + t.integer :move_1_pp_bonuses, null: false, default: 0 + t.integer :move_2_pp_bonuses, null: false, default: 0 + t.integer :move_3_pp_bonuses, null: false, default: 0 + t.integer :move_4_pp_bonuses, null: false, default: 0 + + t.timestamps + end + + add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true + + add_foreign_key :pokeviewer_revisions, :pokewalker_pokemon, + column: :pokemon_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_1_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_2_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_3_id + + add_foreign_key :pokeviewer_revisions, :pokewalker_moves, + column: :move_4_id + end +end diff --git a/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb b/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb new file mode 100644 index 0000000..058a591 --- /dev/null +++ b/db/migrate/20171015171544_make_met_level_nullable.pokeviewer.rb @@ -0,0 +1,6 @@ +# This migration comes from pokeviewer (originally 20170924035127) +class MakeMetLevelNullable < ActiveRecord::Migration[5.1] + def change + change_column :pokeviewer_pokemon, :met_level, :integer, null: true + end +end diff --git a/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb b/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..8ad7f77 --- /dev/null +++ b/db/migrate/20171015171545_add_ot_gender_to_pokemon.pokeviewer.rb @@ -0,0 +1,6 @@ +# This migration comes from pokeviewer (originally 20170924152817) +class AddOtGenderToPokemon < ActiveRecord::Migration[5.1] + def change + add_column :pokeviewer_pokemon, :ot_gender, :string, null: false, default: "" + end +end diff --git a/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb b/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..794dd13 --- /dev/null +++ b/db/migrate/20171015171546_add_storage_info_to_pokemon.pokeviewer.rb @@ -0,0 +1,7 @@ +# This migration comes from pokeviewer (originally 20170924160524) +class AddStorageInfoToPokemon < ActiveRecord::Migration[5.1] + def change + add_column :pokeviewer_pokemon, :box, :integer, null: true + add_column :pokeviewer_pokemon, :slot, :integer, null: true + end +end diff --git a/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb new file mode 100644 index 0000000..90323d1 --- /dev/null +++ b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb @@ -0,0 +1,16 @@ +# This migration comes from pokeviewer (originally 20170924224550) +class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_boxes do |t| + t.references :trainer, null: false + t.integer :number, null: false + t.string :name, null: false + + t.timestamps + end + + add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id + + add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true + end +end diff --git a/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb b/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb new file mode 100644 index 0000000..c5589b0 --- /dev/null +++ b/db/migrate/20171015171548_create_pokeviewer_locations.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170925013807) +class CreatePokeviewerLocations < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_locations do |t| + t.string :name, null: false + + t.timestamps + end + end +end diff --git a/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb b/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb new file mode 100644 index 0000000..01f4c2d --- /dev/null +++ b/db/migrate/20171015171549_add_ribbons_to_revision.pokeviewer.rb @@ -0,0 +1,25 @@ +# This migration comes from pokeviewer (originally 20170929211529) +class AddRibbonsToRevision < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_revisions do |t| + t.integer :cool_ribbons, null: false, default: 0 + t.integer :beauty_ribbons, null: false, default: 0 + t.integer :cute_ribbons, null: false, default: 0 + t.integer :smart_ribbons, null: false, default: 0 + t.integer :tough_ribbons, null: false, default: 0 + + t.boolean :champion_ribbon, default: false + t.boolean :winning_ribbon, default: false + t.boolean :victory_ribbon, default: false + t.boolean :artist_ribbon, default: false + t.boolean :effort_ribbon, default: false + t.boolean :marine_ribbon, default: false + t.boolean :land_ribbon, default: false + t.boolean :sky_ribbon, default: false + t.boolean :country_ribbon, default: false + t.boolean :national_ribbon, default: false + t.boolean :earth_ribbon, default: false + t.boolean :world_ribbon, default: false + end + end +end diff --git a/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb b/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb new file mode 100644 index 0000000..5c055f4 --- /dev/null +++ b/db/migrate/20171015171550_create_pokeviewer_gift_ribbons.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170929221317) +class CreatePokeviewerGiftRibbons < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_gift_ribbons do |t| + t.string :description, null: false + + t.timestamps + end + end +end diff --git a/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb b/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb new file mode 100644 index 0000000..5bef8d5 --- /dev/null +++ b/db/migrate/20171015171551_add_gift_ribbons_to_trainer.pokeviewer.rb @@ -0,0 +1,35 @@ +# This migration comes from pokeviewer (originally 20170930021856) +class AddGiftRibbonsToTrainer < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_trainers do |t| + t.references :marine_ribbon, null: true + t.references :land_ribbon, null: true + t.references :sky_ribbon, null: true + t.references :country_ribbon, null: true + t.references :national_ribbon, null: true + t.references :earth_ribbon, null: true + t.references :world_ribbon, null: true + end + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :marine_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :land_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :sky_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :country_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :national_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :earth_ribbon_id + + add_foreign_key :pokeviewer_trainers, :pokeviewer_gift_ribbons, + column: :world_ribbon_id + end +end diff --git a/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb b/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb new file mode 100644 index 0000000..7adc387 --- /dev/null +++ b/db/migrate/20171015171552_create_pokeviewer_items.pokeviewer.rb @@ -0,0 +1,17 @@ +# This migration comes from pokeviewer (originally 20170930185514) +class CreatePokeviewerItems < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_items do |t| + t.string :name, null: false + t.boolean :tm, null: false, default: false + t.references :move, null: true + t.string :rs_description + t.string :frlg_description + t.string :emerald_description + + t.timestamps + end + + add_foreign_key :pokeviewer_items, :pokeviewer_moves, column: :move_id + end +end diff --git a/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb b/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb new file mode 100644 index 0000000..0eb7cb1 --- /dev/null +++ b/db/migrate/20171015171553_add_description_and_type_to_moves.pokeviewer.rb @@ -0,0 +1,15 @@ +# This migration comes from pokeviewer (originally 20170930190647) +class AddDescriptionAndTypeToMoves < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_moves do |t| + t.string :move_type, null: false, default: "" + t.string :rs_description, null: false, default: "" + t.string :frlg_description, null: false, default: "" + t.string :emerald_description + end + + change_column_default :pokeviewer_moves, :move_type, nil + change_column_default :pokeviewer_moves, :rs_description, nil + change_column_default :pokeviewer_moves, :frlg_description, nil + end +end diff --git a/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb b/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb new file mode 100644 index 0000000..f7246de --- /dev/null +++ b/db/migrate/20171015171554_rename_revision_hold_item.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20170930213633) +class RenameRevisionHoldItem < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_revisions do |t| + t.rename :hold_item, :item_id + end + + add_foreign_key :pokeviewer_revisions, :pokeviewer_items, column: :item_id + end +end diff --git a/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb new file mode 100644 index 0000000..afb5987 --- /dev/null +++ b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb @@ -0,0 +1,31 @@ +# This migration comes from pokeviewer (originally 20171003154157) +class RenamePokemonMetLocation < ActiveRecord::Migration[5.1] + def up + add_column :pokeviewer_pokemon, :location_id, :integer, null: true + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_locations, + column: :location_id + + Pokeviewer::Pokemon.all.each do |p| + unless p.met_location.nil? + p.location_id = p.met_location.to_i + p.save! + end + end + + remove_column :pokeviewer_pokemon, :met_location + end + + def down + add_column :pokeviewer_pokemon, :met_location, :string + + Pokeviewer::Pokemon.all.each do |p| + unless p.location_id.nil? + p.met_location = p.location_id.to_s + p.save! + end + end + + remove_column :pokeviewer_pokemon, :location_id + end +end diff --git a/db/migrate/20171015171556_remove_boxes.pokeviewer.rb b/db/migrate/20171015171556_remove_boxes.pokeviewer.rb new file mode 100644 index 0000000..c3cbbb1 --- /dev/null +++ b/db/migrate/20171015171556_remove_boxes.pokeviewer.rb @@ -0,0 +1,107 @@ +# This migration comes from pokeviewer (originally 20171003191205) +class RemoveBoxes < ActiveRecord::Migration[5.1] + def up + change_table :pokeviewer_trainers do |t| + t.string :box_1_name, null: false, default: "" + t.string :box_2_name, null: false, default: "" + t.string :box_3_name, null: false, default: "" + t.string :box_4_name, null: false, default: "" + t.string :box_5_name, null: false, default: "" + t.string :box_6_name, null: false, default: "" + t.string :box_7_name, null: false, default: "" + t.string :box_8_name, null: false, default: "" + t.string :box_9_name, null: false, default: "" + t.string :box_10_name, null: false, default: "" + t.string :box_11_name, null: false, default: "" + t.string :box_12_name, null: false, default: "" + t.string :box_13_name, null: false, default: "" + t.string :box_14_name, null: false, default: "" + end + + change_column_default :pokeviewer_trainers, :box_1_name, nil + change_column_default :pokeviewer_trainers, :box_2_name, nil + change_column_default :pokeviewer_trainers, :box_3_name, nil + change_column_default :pokeviewer_trainers, :box_4_name, nil + change_column_default :pokeviewer_trainers, :box_5_name, nil + change_column_default :pokeviewer_trainers, :box_6_name, nil + change_column_default :pokeviewer_trainers, :box_7_name, nil + change_column_default :pokeviewer_trainers, :box_8_name, nil + change_column_default :pokeviewer_trainers, :box_9_name, nil + change_column_default :pokeviewer_trainers, :box_10_name, nil + change_column_default :pokeviewer_trainers, :box_11_name, nil + change_column_default :pokeviewer_trainers, :box_12_name, nil + change_column_default :pokeviewer_trainers, :box_13_name, nil + change_column_default :pokeviewer_trainers, :box_14_name, nil + + Pokeviewer::Trainer.all.each do |t| + boxes = ActiveRecord::Base.connection.select_all( + "SELECT * FROM pokeviewer_boxes WHERE trainer_id = ? ORDER BY number ASC", + t.trainer_id).map { |b| b["name"] } + + t.box_1_name = boxes.shift + t.box_2_name = boxes.shift + t.box_3_name = boxes.shift + t.box_4_name = boxes.shift + t.box_5_name = boxes.shift + t.box_6_name = boxes.shift + t.box_7_name = boxes.shift + t.box_8_name = boxes.shift + t.box_9_name = boxes.shift + t.box_10_name = boxes.shift + t.box_11_name = boxes.shift + t.box_12_name = boxes.shift + t.box_13_name = boxes.shift + t.box_14_name = boxes.shift + + t.save + end + + drop_table :pokeviewer_boxes + end + + def down + create_table :pokeviewer_boxes do |t| + t.integer "trainer_id", null: false + t.integer "number", null: false + t.string "name", null: false + + t.timestamps + end + + add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true + + add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id + + Pokeviewer::Trainer.all.each do |t| + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 1, name: t.box_1_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 2, name: t.box_2_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 3, name: t.box_3_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 4, name: t.box_4_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 5, name: t.box_5_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 6, name: t.box_6_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 7, name: t.box_7_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 8, name: t.box_8_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 9, name: t.box_9_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 10, name: t.box_10_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 11, name: t.box_11_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 12, name: t.box_12_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 13, name: t.box_13_name) + Pokeviewer::Box.create(trainer_id: t.trainer_id, number: 14, name: t.box_14_name) + end + + remove_column :pokeviewer_trainers, :box_1_name + remove_column :pokeviewer_trainers, :box_2_name + remove_column :pokeviewer_trainers, :box_3_name + remove_column :pokeviewer_trainers, :box_4_name + remove_column :pokeviewer_trainers, :box_5_name + remove_column :pokeviewer_trainers, :box_6_name + remove_column :pokeviewer_trainers, :box_7_name + remove_column :pokeviewer_trainers, :box_8_name + remove_column :pokeviewer_trainers, :box_9_name + remove_column :pokeviewer_trainers, :box_10_name + remove_column :pokeviewer_trainers, :box_11_name + remove_column :pokeviewer_trainers, :box_12_name + remove_column :pokeviewer_trainers, :box_13_name + remove_column :pokeviewer_trainers, :box_14_name + end +end diff --git a/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb b/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb new file mode 100644 index 0000000..01f6f97 --- /dev/null +++ b/db/migrate/20171015171557_add_pokeball_to_pokemon.pokeviewer.rb @@ -0,0 +1,10 @@ +# This migration comes from pokeviewer (originally 20171004203404) +class AddPokeballToPokemon < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_pokemon do |t| + t.string :pokeball, null: false, default: :poke + end + + change_column_default :pokeviewer_pokemon, :pokeball, nil + end +end diff --git a/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb b/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb new file mode 100644 index 0000000..3120683 --- /dev/null +++ b/db/migrate/20171015171558_create_pokeviewer_abilities.pokeviewer.rb @@ -0,0 +1,13 @@ +# This migration comes from pokeviewer (originally 20171011015325) +class CreatePokeviewerAbilities < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_abilities do |t| + t.string :name, null: false, limit: 191 + t.string :description, null: false + + t.timestamps + end + + add_index :pokeviewer_abilities, :name, unique: true + end +end diff --git a/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb b/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb new file mode 100644 index 0000000..a7da236 --- /dev/null +++ b/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb @@ -0,0 +1,20 @@ +# This migration comes from pokeviewer (originally 20171011015648) +class AddTypeAndAbilityToSpecies < ActiveRecord::Migration[5.1] + def change + change_table :pokeviewer_species do |t| + t.string :type_1, null: false, default: "" + t.string :type_2 + t.integer :ability_1_id, null: false, default: 0 + t.integer :ability_2_id + end + + change_column_default :pokeviewer_species, :type_1, nil + change_column_default :pokeviewer_species, :ability_1_id, nil + + add_foreign_key :pokeviewer_species, :pokeviewer_abilities, + column: :ability_1_id + + add_foreign_key :pokeviewer_species, :pokeviewer_abilities, + column: :ability_2_id + end +end -- cgit 1.4.1