From 100270703f06e7fa1f12ee8bb6aee297c56ce49b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 29 Jan 2018 21:20:46 -0500 Subject: Updated pokeviewer (Pokédex) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._create_pokeviewer_pokedex_entries.pokeviewer.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/migrate/20180130021851_create_pokeviewer_pokedex_entries.pokeviewer.rb (limited to 'db/migrate') 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 @@ +# This migration comes from pokeviewer (originally 20180129213822) +class CreatePokeviewerPokedexEntries < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_pokedex_entries do |t| + t.references :trainer, null: true + t.references :species, null: true + t.boolean :caught, null: true, default: false + + t.timestamps + end + + add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_trainers, + column: :trainer_id + + add_foreign_key :pokeviewer_pokedex_entries, :pokeviewer_species, + column: :species_id + + add_index :pokeviewer_pokedex_entries, [:trainer_id, :species_id], + unique: true + end +end -- cgit 1.4.1