about summary refs log tree commit diff stats
path: root/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb')
-rw-r--r--db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb new file mode 100644 index 0000000..90323d1 --- /dev/null +++ b/db/migrate/20171015171547_create_pokeviewer_boxes.pokeviewer.rb
@@ -0,0 +1,16 @@
1# This migration comes from pokeviewer (originally 20170924224550)
2class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1]
3 def change
4 create_table :pokeviewer_boxes do |t|
5 t.references :trainer, null: false
6 t.integer :number, null: false
7 t.string :name, null: false
8
9 t.timestamps
10 end
11
12 add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id
13
14 add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true
15 end
16end