Forum: Ruby on Rails problem with migration

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C8fa0c2ee1f8656c3015d80a13b3ac9c?d=identicon&s=25 Sasha Sasha (siansor)
on 2009-05-03 00:04
Hi
I have a problem im migration

1) ruby script/generate migration add_price

2)

class AddPrice < ActiveRecord::Migration
  def self.up
      add_column :products, :price, :precesion => 8, :scale => 2 ,
:default => 0
  end

  def self.down
       remove_column :products, :price
  end
end

3)Error

==  AddPrice: migrating
=======================================================
-- add_column(:products, :price, :decimal, {:scale=>2, :default=>0,
:precesion=>8})
rake aborted!
An error has occurred, all later migrations canceled:

Error adding decimal column: precision cannot be empty if scale if
specified


??? help me
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2009-05-03 00:37
(Received via mailing list)
On May 2, 2009, at 6:04 PM, Sasha Sasha wrote:

>      add_column :products, :price, :precesion => 8, :scale => 2 ,
> ==  AddPrice: migrating
> ??? help me
Compare the spelling in the error message to the spelling in your
migration.

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
Ced56202e9039027cfc2da2f70457977?d=identicon&s=25 E. Litwin (Guest)
on 2009-05-03 01:34
(Received via mailing list)
Change :precesion to :precision (second e should be an i)

On May 2, 3:04 pm, Sasha Sasha <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.