about summary refs log tree commit diff stats
path: root/db/migrate/20170917002857_create_pokeviewer_revisions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20170917002857_create_pokeviewer_revisions.rb')
-rw-r--r--db/migrate/20170917002857_create_pokeviewer_revisions.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/db/migrate/20170917002857_create_pokeviewer_revisions.rb b/db/migrate/20170917002857_create_pokeviewer_revisions.rb new file mode 100644 index 0000000..f6755da --- /dev/null +++ b/db/migrate/20170917002857_create_pokeviewer_revisions.rb
@@ -0,0 +1,31 @@
1class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1]
2 def change
3 create_table :pokeviewer_revisions do |t|
4 t.references :pokemon, null: false
5 t.integer :sequential_id, null: false
6 t.string :nickname, null: false
7 t.integer :experience, null: false
8 t.integer :level, null: false
9 t.integer :hp, null: false
10 t.integer :attack, null: false
11 t.integer :defense, null: false
12 t.integer :special_attack, null: false
13 t.integer :special_defense, null: false
14 t.integer :speed, null: false
15 t.integer :coolness, null: false
16 t.integer :beauty, null: false
17 t.integer :cuteness, null: false
18 t.integer :smartness, null: false
19 t.integer :toughness, null: false
20 t.integer :sheen, null: false
21 t.integer :hold_item, null: true
22
23 t.timestamps
24 end
25
26 add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true
27
28 add_foreign_key :pokeviewer_revisions, :pokewalker_pokemon,
29 column: :pokemon_id
30 end
31end