about summary refs log tree commit diff stats
path: root/db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb')
-rw-r--r--db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb b/db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb index 8456456..a6f1bec 100644 --- a/db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb +++ b/db/migrate/20180129213822_create_pokeviewer_pokedex_entries.rb
@@ -1,6 +1,6 @@
1class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1] 1class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1]
2 def change 2 def change
3 create_table :pokeviewer_pokedex_entries do |t| 3 create_table :pokedex_entries do |t|
4 t.references :trainer, null: true 4 t.references :trainer, null: true
5 t.references :species, null: true 5 t.references :species, null: true
6 t.boolean :caught, null: true, default: false 6 t.boolean :caught, null: true, default: false
@@ -8,13 +8,13 @@ class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1]
8 t.timestamps 8 t.timestamps
9 end 9 end
10 10
11 add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_trainers, 11 add_foreign_key :pokedex_entries, :trainers,
12 column: :trainer_id 12 column: :trainer_id
13 13
14 add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_species, 14 add_foreign_key :pokedex_entries, :species,
15 column: :species_id 15 column: :species_id
16 16
17 add_index :pokeviewer_pokedex_entries, [:trainer_id, :species_id], 17 add_index :pokedex_entries, [:trainer_id, :species_id],
18 unique: true 18 unique: true
19 end 19 end
20end 20end