Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

decimal options not being picked up

#142

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)

Reported by Jon · October 20th, 2007 @ 10:02 AM

State: resolved
Milestone: none
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Jon
    Jon

    Nevermind - it seems that I can't spell precision correctly. Please ignore this ticket

    October 20th, 2007 @ 04:10 PM

  2. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to resolved

    October 29th, 2007 @ 12:26 PM

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.