about summary refs log tree commit diff stats
path: root/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb')
-rw-r--r--db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb new file mode 100644 index 0000000..dd14d8c --- /dev/null +++ b/db/migrate/20171015171541_create_pokeviewer_pokemon.pokeviewer.rb
@@ -0,0 +1,32 @@
1# This migration comes from pokeviewer (originally 20170916234251)
2class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1]
3 def change
4 create_table :pokeviewer_pokemon do |t|
5 t.string :uuid, null: false, limit: 191
6 t.references :species, null: false
7 t.references :trainer, null: true
8 t.string :key, null: true, limit: 191
9 t.string :ot_name, null: false
10 t.integer :ot_number, null: false
11 t.string :met_type, null: false
12 t.string :met_location, null: true
13 t.integer :met_level, null: false
14 t.boolean :shiny, null: false, default: false
15 t.string :nature, null: false
16 t.string :gender, null: false
17 t.boolean :second_ability, null: false
18 t.string :unown_letter, null: true, limit: 1
19
20 t.timestamps
21 end
22
23 add_index :pokeviewer_pokemon, :uuid, unique: true
24 add_index :pokeviewer_pokemon, :key, unique: true
25
26 add_foreign_key :pokeviewer_pokemon, :pokeviewer_species,
27 column: :species_id
28
29 add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainers,
30 column: :trainer_id
31 end
32end