1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00
BikeShed-1/db/migrate/20130816015219_bike_condition_id_to_int.rb

16 lines
355 B
Ruby
Raw Normal View History

class BikeConditionIdToInt < ActiveRecord::Migration
def up
#for Postgres
connection.execute(%q{
alter table bikes
alter column bike_condition_id
type integer using cast(bike_condition_id as integer)
})
end
def down
#you really don't want to go back
change_column :bikes, :bike_condition_id, :string
end
end