about summary refs log tree commit diff stats
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170916234251_create_pokeviewer_pokemon.rb2
-rw-r--r--db/migrate/20170924224550_create_pokeviewer_boxes.rb2
-rw-r--r--db/migrate/20170930185514_create_pokeviewer_items.rb16
-rw-r--r--db/migrate/20170930190647_add_description_and_type_to_moves.rb14
-rw-r--r--db/migrate/20170930213633_rename_revision_hold_item.rb9
5 files changed, 41 insertions, 2 deletions
diff --git a/db/migrate/20170916234251_create_pokeviewer_pokemon.rb b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb index dd9994c..a8b17af 100644 --- a/db/migrate/20170916234251_create_pokeviewer_pokemon.rb +++ b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb
@@ -25,7 +25,7 @@ class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1]
25 add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, 25 add_foreign_key :pokeviewer_pokemon, :pokeviewer_species,
26 column: :species_id 26 column: :species_id
27 27
28 add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainer, 28 add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainers,
29 column: :trainer_id 29 column: :trainer_id
30 end 30 end
31end 31end
diff --git a/db/migrate/20170924224550_create_pokeviewer_boxes.rb b/db/migrate/20170924224550_create_pokeviewer_boxes.rb index 02f6fa9..4db2108 100644 --- a/db/migrate/20170924224550_create_pokeviewer_boxes.rb +++ b/db/migrate/20170924224550_create_pokeviewer_boxes.rb
@@ -8,7 +8,7 @@ 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_trainer, column: :trainer_id 11 add_foreign_key :pokeviewer_boxes, :pokeviewer_trainers, column: :trainer_id
12 12
13 add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true 13 add_index :pokeviewer_boxes, [:trainer_id, :number], unique: true
14 end 14 end
diff --git a/db/migrate/20170930185514_create_pokeviewer_items.rb b/db/migrate/20170930185514_create_pokeviewer_items.rb new file mode 100644 index 0000000..82cf3c2 --- /dev/null +++ b/db/migrate/20170930185514_create_pokeviewer_items.rb
@@ -0,0 +1,16 @@
1class CreatePokeviewerItems < ActiveRecord::Migration[5.1]
2 def change
3 create_table :pokeviewer_items do |t|
4 t.string :name, null: false
5 t.boolean :tm, null: false, default: false
6 t.references :move, null: true
7 t.string :rs_description
8 t.string :frlg_description
9 t.string :emerald_description
10
11 t.timestamps
12 end
13
14 add_foreign_key :pokeviewer_items, :pokeviewer_moves, column: :move_id
15 end
16end
diff --git a/db/migrate/20170930190647_add_description_and_type_to_moves.rb b/db/migrate/20170930190647_add_description_and_type_to_moves.rb new file mode 100644 index 0000000..d2fe032 --- /dev/null +++ b/db/migrate/20170930190647_add_description_and_type_to_moves.rb
@@ -0,0 +1,14 @@
1class AddDescriptionAndTypeToMoves < ActiveRecord::Migration[5.1]
2 def change
3 change_table :pokeviewer_moves do |t|
4 t.string :move_type, null: false, default: ""
5 t.string :rs_description, null: false, default: ""
6 t.string :frlg_description, null: false, default: ""
7 t.string :emerald_description
8 end
9
10 change_column_default :pokeviewer_moves, :move_type, nil
11 change_column_default :pokeviewer_moves, :rs_description, nil
12 change_column_default :pokeviewer_moves, :frlg_description, nil
13 end
14end
diff --git a/db/migrate/20170930213633_rename_revision_hold_item.rb b/db/migrate/20170930213633_rename_revision_hold_item.rb new file mode 100644 index 0000000..b2ff736 --- /dev/null +++ b/db/migrate/20170930213633_rename_revision_hold_item.rb
@@ -0,0 +1,9 @@
1class RenameRevisionHoldItem < ActiveRecord::Migration[5.1]
2 def change
3 change_table :pokeviewer_revisions do |t|
4 t.rename :hold_item, :item_id
5 end
6
7 add_foreign_key :pokeviewer_revisions, :pokeviewer_items, column: :item_id
8 end
9end