Forum: Ruby on Rails Schema.rb and MySQL decimal

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Marc E. (Guest)
on 2006-04-11 12:55
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
Ashley M. (Guest)
on 2006-04-12 16:22
(Received via mailing list)
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
seth b. (Guest)
on 2006-04-26 14:12
(Received via mailing list)
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 topic is locked and can not be replied to.