Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # changing field from string to integer using Rails migration
- class MakeStatusInteger < ActiveRecord::Migration
- def self.up
- connection.execute(%q{
- alter table purchases
- alter column status
- type integer using cast(status as integer)})
- end
- def self.down
- change_column :purchases, :status, :string
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement