Daniel
Daniel

Reputation: 16226

rails decimal precision and scale

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.

Upvotes: 2

Views: 3389

Answers (1)

hgmnz
hgmnz

Reputation: 13306

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

Ref: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/change_column

Upvotes: 3

Related Questions