diff options
Diffstat (limited to 'db/migrate/20170924224550_create_pokeviewer_boxes.rb')
-rw-r--r-- | db/migrate/20170924224550_create_pokeviewer_boxes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/20170924224550_create_pokeviewer_boxes.rb b/db/migrate/20170924224550_create_pokeviewer_boxes.rb index 4db2108..7a100c3 100644 --- a/db/migrate/20170924224550_create_pokeviewer_boxes.rb +++ b/db/migrate/20170924224550_create_pokeviewer_boxes.rb | |||
@@ -1,6 +1,6 @@ | |||
1 | class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1] | 1 | class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1] |
2 | def change | 2 | def change |
3 | create_table :pokeviewer_boxes do |t| | 3 | create_table :boxes do |t| |
4 | t.references :trainer, null: false | 4 | t.references :trainer, null: false |
5 | t.integer :number, null: false | 5 | t.integer :number, null: false |
6 | t.string :name, null: false | 6 | t.string :name, null: false |
@@ -8,8 +8,8 @@ class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1] | |||
8 | t.timestamps | 8 | t.timestamps |
9 | end | 9 | end |
10 | 10 | ||
11 | add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id | 11 | add_foreign_key :boxes, :trainers, column: :trainer_id |
12 | 12 | ||
13 | add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true | 13 | add_index :boxes, [:trainer_id, :number], unique: true |
14 | end | 14 | end |
15 | end | 15 | end |