From 941f7a267b631d41ac728fe17f69d13299ce748c Mon Sep 17 00:00:00 2001 From: "John N. Milner" Date: Sun, 7 Apr 2013 16:50:53 -0400 Subject: [PATCH] Add migration to accompany 55fbd0630527761077a15988b2229a6afac548e4 --- db/migrate/20130405012238_alter_bike.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20130405012238_alter_bike.rb diff --git a/db/migrate/20130405012238_alter_bike.rb b/db/migrate/20130405012238_alter_bike.rb new file mode 100644 index 0000000..cecfeeb --- /dev/null +++ b/db/migrate/20130405012238_alter_bike.rb @@ -0,0 +1,13 @@ +class AlterBike < ActiveRecord::Migration + def up + add_column(:bikes, :shop_id, :string) + add_index :bikes, :shop_id, :unique => true + remove_index :bikes, :column => :serial_number + end + + def down + remove_index :bikes, :column => :shop_id + remove_column(:bikes, :shop_id) + add_index :bikes, :serial_number, :unique => true + end +end