#142 ✓resolved

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

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

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket