about summary refs log tree commit diff stats
path: root/db/migrate/20170917011258_create_pokeviewer_revisions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20170917011258_create_pokeviewer_revisions.rb')
-rw-r--r--db/migrate/20170917011258_create_pokeviewer_revisions.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/db/migrate/20170917011258_create_pokeviewer_revisions.rb b/db/migrate/20170917011258_create_pokeviewer_revisions.rb index 4733303..0528ea4 100644 --- a/db/migrate/20170917011258_create_pokeviewer_revisions.rb +++ b/db/migrate/20170917011258_create_pokeviewer_revisions.rb
@@ -1,6 +1,6 @@
1class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1] 1class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1]
2 def change 2 def change
3 create_table :pokeviewer_revisions do |t| 3 create_table :revisions do |t|
4 t.references :pokemon, null: false 4 t.references :pokemon, null: false
5 t.integer :sequential_id, null: false 5 t.integer :sequential_id, null: false
6 t.string :nickname, null: false 6 t.string :nickname, null: false
@@ -31,21 +31,21 @@ class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1]
31 t.timestamps 31 t.timestamps
32 end 32 end
33 33
34 add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true 34 add_index :revisions, [:pokemon_id, :sequential_id], unique: true
35 35
36 add_foreign_key :pokeviewer_revisions, :pokeviewer_pokemon, 36 add_foreign_key :revisions, :pokemon,
37 column: :pokemon_id 37 column: :pokemon_id
38 38
39 add_foreign_key :pokeviewer_revisions, :pokeviewer_moves, 39 add_foreign_key :revisions, :moves,
40 column: :move_1_id 40 column: :move_1_id
41 41
42 add_foreign_key :pokeviewer_revisions, :pokeviewer_moves, 42 add_foreign_key :revisions, :moves,
43 column: :move_2_id 43 column: :move_2_id
44 44
45 add_foreign_key :pokeviewer_revisions, :pokeviewer_moves, 45 add_foreign_key :revisions, :moves,
46 column: :move_3_id 46 column: :move_3_id
47 47
48 add_foreign_key :pokeviewer_revisions, :pokeviewer_moves, 48 add_foreign_key :revisions, :moves,
49 column: :move_4_id 49 column: :move_4_id
50 end 50 end
51end 51end