mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
12 years ago
3 changed files with 21 additions and 6 deletions
@ -0,0 +1,15 @@ |
|||||
|
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 |
Loading…
Reference in new issue