small medium large xlarge

16 Nov 2007, 20:01
Randall Desmond (5 posts)

I goofed on copying page 141 by making total_price an integer instead of a decimal. How do I change that?

Suppose to be.. t.column :total_price, :decimal, :null => false, :precision => 8, :scale => 2 I did… t.column :total_price, :integer, :null => false, :precision => 8, :scale => 2

I know I have to rake db:migrate something… I’m just not sure what the something should be.

Thanks, Randall

16 Nov 2007, 21:40
Justin (1 post)

provided you have a self.down in your migration that removes the column, you could simply run “rake db:migrate VERSION=1” to get rid of the column. Then edit your migration so its now a decimal and run “rake db:migrate” to re-add it.

You must be logged in to comment