diff options
Diffstat (limited to 'db/migrate/20170916234251_create_pokeviewer_pokemon.rb')
-rw-r--r-- | db/migrate/20170916234251_create_pokeviewer_pokemon.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/db/migrate/20170916234251_create_pokeviewer_pokemon.rb b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb index a8b17af..ec90875 100644 --- a/db/migrate/20170916234251_create_pokeviewer_pokemon.rb +++ b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb | |||
@@ -1,6 +1,6 @@ | |||
1 | class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] | 1 | class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] |
2 | def change | 2 | def change |
3 | create_table :pokeviewer_pokemon do |t| | 3 | create_table :pokemon do |t| |
4 | t.string :uuid, null: false, limit: 191 | 4 | t.string :uuid, null: false, limit: 191 |
5 | t.references :species, null: false | 5 | t.references :species, null: false |
6 | t.references :trainer, null: true | 6 | t.references :trainer, null: true |
@@ -19,13 +19,13 @@ class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] | |||
19 | t.timestamps | 19 | t.timestamps |
20 | end | 20 | end |
21 | 21 | ||
22 | add_index :pokeviewer_pokemon, :uuid, unique: true | 22 | add_index :pokemon, :uuid, unique: true |
23 | add_index :pokeviewer_pokemon, :key, unique: true | 23 | add_index :pokemon, :key, unique: true |
24 | 24 | ||
25 | add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, | 25 | add_foreign_key :pokemon, :species, |
26 | column: :species_id | 26 | column: :species_id |
27 | 27 | ||
28 | add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainers, | 28 | add_foreign_key :pokemon, :trainers, |
29 | column: :trainer_id | 29 | column: :trainer_id |
30 | end | 30 | end |
31 | end | 31 | end |