Schema.rb and MySQL decimal

Hi,

I have a mysql schema with some decimal(20,20) fields. Now, I made a
rake db_schema_dump for deployment of my applications on other machines.
Rails created a schema.rb with the decimal fields as float.
After a rake db_schema_import the fields are just float not decimal. How
can I force rails to create decimal(20,20) columns instead of float?

Thx.
Marc

On Tuesday 11 April 2006 09:55, Marc Eckart wrote:

Hi,

I have a mysql schema with some decimal(20,20) fields. Now, I made a
rake db_schema_dump for deployment of my applications on other machines.
Rails created a schema.rb with the decimal fields as float.
After a rake db_schema_import the fields are just float not decimal. How
can I force rails to create decimal(20,20) columns instead of float?

Thx.
Marc

Marc,

This is what I’ve been working on in a decimals patch:
http://dev.rubyonrails.org/ticket/4274

See my recent post re decimal support, as there is an issue with the
schema
dumper where you will get decimal rather than decimal(20,20) but this is
a 2
line fix I might even do tonight.

Ashley

So what’s the status on this? Will we be able to create decimal columns
from
a schema.rb any time soon? I have tests failing because I originially
created my DB with a SQL file, but when it goes to test the decimals are
set
to floats…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs