From 1d621019d7bf74b65898e009aef31766c7e7572b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 16 Sep 2017 22:40:16 -0400 Subject: Created a bunch of models --- .../20170917002857_create_pokeviewer_revisions.rb | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 db/migrate/20170917002857_create_pokeviewer_revisions.rb (limited to 'db/migrate/20170917002857_create_pokeviewer_revisions.rb') 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 @@ +class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revisions do |t| + t.references :pokemon, null: false + t.integer :sequential_id, null: false + t.string :nickname, null: false + t.integer :experience, null: false + t.integer :level, null: false + t.integer :hp, null: false + t.integer :attack, null: false + t.integer :defense, null: false + t.integer :special_attack, null: false + t.integer :special_defense, null: false + t.integer :speed, null: false + t.integer :coolness, null: false + t.integer :beauty, null: false + t.integer :cuteness, null: false + t.integer :smartness, null: false + t.integer :toughness, null: false + t.integer :sheen, null: false + t.integer :hold_item, null: true + + t.timestamps + end + + add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true + + add_foreign_key :pokeviewer_revisions, :pokewalker_pokemon, + column: :pokemon_id + end +end -- cgit 1.4.1