about summary refs log tree commit diff stats
path: root/db/migrate
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 14:16:11 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 14:16:11 -0400
commita29b86011d9c53709279d125f4501140c17ccc1e (patch)
tree4d39103e4d6a8d3302ebc247b737c8f3868f6314 /db/migrate
parent39a065e9cabdff4d90025ac0090b64aea6941a9d (diff)
downloadpokeviewer-a29b86011d9c53709279d125f4501140c17ccc1e.tar.gz
pokeviewer-a29b86011d9c53709279d125f4501140c17ccc1e.tar.bz2
pokeviewer-a29b86011d9c53709279d125f4501140c17ccc1e.zip
Changed the way that the hold item column is migrated
MySQL seems to choke on the previous way that the hold_item column
became the item_id column; since this is an old migration and would only
be run retroactively anyway, we can change this to just dropping the
hold_item column and adding the item_id column.
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170930213633_rename_revision_hold_item.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20170930213633_rename_revision_hold_item.rb b/db/migrate/20170930213633_rename_revision_hold_item.rb index b2ff736..e4fdbf0 100644 --- a/db/migrate/20170930213633_rename_revision_hold_item.rb +++ b/db/migrate/20170930213633_rename_revision_hold_item.rb
@@ -1,7 +1,9 @@
1class RenameRevisionHoldItem < ActiveRecord::Migration[5.1] 1class RenameRevisionHoldItem < ActiveRecord::Migration[5.1]
2 def change 2 def change
3 remove_column :pokeviewer_revisions, :hold_item, :integer
4
3 change_table :pokeviewer_revisions do |t| 5 change_table :pokeviewer_revisions do |t|
4 t.rename :hold_item, :item_id 6 t.integer :item_id
5 end 7 end
6 8
7 add_foreign_key :pokeviewer_revisions, :pokeviewer_items, column: :item_id 9 add_foreign_key :pokeviewer_revisions, :pokeviewer_items, column: :item_id