From 5e58948fbdd918f45b25e5a5330ba85481a6f75e Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Oct 2017 14:35:11 -0400 Subject: Fixed two migration similar to previous --- db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb | 4 +++- .../20171015171559_add_type_and_ability_to_species.pokeviewer.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'db') diff --git a/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb index afb5987..fddeac0 100644 --- a/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb +++ b/db/migrate/20171015171555_rename_pokemon_met_location.pokeviewer.rb @@ -1,7 +1,9 @@ # This migration comes from pokeviewer (originally 20171003154157) class RenamePokemonMetLocation < ActiveRecord::Migration[5.1] def up - add_column :pokeviewer_pokemon, :location_id, :integer, null: true + change_table :pokeviewer_pokemon do |t| + t.references :location, null: true + end add_foreign_key :pokeviewer_pokemon, :pokeviewer_locations, column: :location_id 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 index a7da236..4a990f4 100644 --- a/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb +++ b/db/migrate/20171015171559_add_type_and_ability_to_species.pokeviewer.rb @@ -4,8 +4,8 @@ class AddTypeAndAbilityToSpecies < ActiveRecord::Migration[5.1] 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 + t.references :ability_1, null: false, default: 0 + t.references :ability_2 end change_column_default :pokeviewer_species, :type_1, nil -- cgit 1.4.1