about summary refs log tree commit diff stats
path: root/db
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 19:15:55 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 19:15:55 -0400
commit687299b33934d25017a226ba6b979e44f0b1f441 (patch)
treeb013bbc0384ac691fcb359a78e7e0234c3eb34f5 /db
parent2721f3768ebd4d279caa967bee210249d93f92cb (diff)
downloadpokeviewer-687299b33934d25017a226ba6b979e44f0b1f441.tar.gz
pokeviewer-687299b33934d25017a226ba6b979e44f0b1f441.tar.bz2
pokeviewer-687299b33934d25017a226ba6b979e44f0b1f441.zip
Added box names
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170924224550_create_pokeviewer_boxes.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20170924224550_create_pokeviewer_boxes.rb b/db/migrate/20170924224550_create_pokeviewer_boxes.rb new file mode 100644 index 0000000..02f6fa9 --- /dev/null +++ b/db/migrate/20170924224550_create_pokeviewer_boxes.rb
@@ -0,0 +1,15 @@
1class CreatePokeviewerBoxes < ActiveRecord::Migration[5.1]
2 def change
3 create_table :pokeviewer_boxes do |t|
4 t.references :trainer, null: false
5 t.integer :number, null: false
6 t.string :name, null: false
7
8 t.timestamps
9 end
10
11 add_foreign_key :pokeviewer_boxes, :pokeviewer_trainer, column: :trainer_id
12
13 add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true
14 end
15end