diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-29 21:20:46 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-29 21:20:46 -0500 |
commit | 100270703f06e7fa1f12ee8bb6aee297c56ce49b (patch) | |
tree | 03ea2e2658cd9e623485a7d86e0c1c224adc80c6 /db/migrate | |
parent | 62ffd6ca978159889a87dfe4321c1c790f9108b6 (diff) | |
download | thoughts-100270703f06e7fa1f12ee8bb6aee297c56ce49b.tar.gz thoughts-100270703f06e7fa1f12ee8bb6aee297c56ce49b.tar.bz2 thoughts-100270703f06e7fa1f12ee8bb6aee297c56ce49b.zip |
Updated pokeviewer (Pokédex)
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb b/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb new file mode 100644 index 0000000..2451ef2 --- /dev/null +++ b/db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb | |||
@@ -0,0 +1,21 @@ | |||
1 | # This migration comes from pokeviewer (originally 20180129213822) | ||
2 | class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1] | ||
3 | def change | ||
4 | create_table :pokeviewer_pokedex_entries do |t| | ||
5 | t.references :trainer, null: true | ||
6 | t.references :species, null: true | ||
7 | t.boolean :caught, null: true, default: false | ||
8 | |||
9 | t.timestamps | ||
10 | end | ||
11 | |||
12 | add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_trainers, | ||
13 | column: :trainer_id | ||
14 | |||
15 | add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_species, | ||
16 | column: :species_id | ||
17 | |||
18 | add_index :pokeviewer_pokedex_entries, [:trainer_id, :species_id], | ||
19 | unique: true | ||
20 | end | ||
21 | end | ||