decimal options not being picked up
Reported by Jon | October 20th, 2007 @ 10:02 AM
With sexy-migrations, when I do:
create_table :foo do
# other sexy migrations
decimal :bar, :precision => 11, :scale => 2
# other sexy migrations
end
MySQL creates a decimal(10,0) column (the default for MySQL)
but when I do:
create_table :foo do |t|
# other sexy migrations
t.column :foo, :decimal, :precision => 11, :scale => 2
# other sexy migrations
end
it works. I have no other migration-related plugins installed. I noticed because db/schema.rb lists the columns as :integer, :limit => 10, :precision => 10, :scale => 0
In script/console, I can run:
ActiveRecord::ConnectionAdapters::Column.new(:type_check, 0, 'decimal').type and it returns :decimal, so I know the type is being picked up, just not the options.
It works fine on SQLite 3, but not MySQL 5.0.13. I'm running Rails 1.2.5 and sexy_migrations rev196 (trunk)
Comments and changes to this ticket
-
Jon October 20th, 2007 @ 04:10 PM
Nevermind - it seems that I can't spell precision correctly. Please ignore this ticket
-
Chris Wanstrath October 29th, 2007 @ 12:26 PM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป