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 --- ...0170917011258_create_pokeviewer_revision_moves.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/migrate/20170917011258_create_pokeviewer_revision_moves.rb (limited to 'db/migrate/20170917011258_create_pokeviewer_revision_moves.rb') diff --git a/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb b/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb new file mode 100644 index 0000000..e061207 --- /dev/null +++ b/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb @@ -0,0 +1,20 @@ +class CreatePokeviewerRevisionMoves < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revision_moves do |t| + t.references :revision, null: false + t.references :move, null: false + t.integer :number, null: false + t.integer :pp_bonuses, null: false, default: 0 + + t.timestamps + end + + add_index :pokeviewer_revision_moves, [:revision_id, :number], unique: true + + add_foreign_key :pokeviewer_revision_moves, :pokeviewer_revisions, + column: :revision_id + + add_foreign_key :pokeviewer_revision_moves, :pokeviewer_moves, + column: :move_id + end +end -- cgit 1.4.1