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.

problem with decimal columns

#238

I have the following in schema.rb:

t.decimal "balance", :precision => 8, :scale => 2, :default => 0.0

Strangely auto_migrations created the column in mysql as decimal(10,0).

Also, whenever I type rake db:auto:migrate auto migrations reports: "change_column("accounts", :balance, :decimal)" even though I have not changed schema.rb.

BTW I think auto_migrations is my favorite plugin ever... it's saved me tremendous amounts of time.

I'm using ubuntu hardy and mysql 5.1.

Reported by Deleted User · July 23rd, 2008 @ 03:00 AM

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

Activity

  1. mileszs
    mileszs

    I can confirm this issue. I am using SQLite3 (on Ubuntu Hardy, also, actually).

    It appears that line 121 in lib/auto_migrations.rb is always evaluating to true on decimal fields for the attributes 'precision' and 'scale'. The expression 'fields_in_db[field].send(att)' is nil for precision and scale, every time.

    I'm sorry to take it this far and then drop the ball. I will try to dig in further as soon as I can.

    November 14th, 2008 @ 06:22 AM

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.