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)