views:

210

answers:

1

I have about 30 tables in a rails app and there are about 6 tables for which I would like to change the precision and scale of some of the decimal columns. How do you go about doing that for already existing columns? Do you need to do each new migration separately, or can they all be done at once.

+1  A: 

change_column :table_name, :column_name, :type
will update the column's type.

Ref: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/change%5Fcolumn

hgimenez