Error running rake db:test:prepare


#1

Hey all,

I am getting syntax errors in my schema.rb when I run rake
db:test:prepare. In my migrations, I have created columns that look
like this…

add_column :prizes, :“paypal_amount”, :decimal, :precision => 8, :scale
=> 2, :null=>false, :default=>0

and this works fine and creates the column correctly in the DB. The
corresponding line in schema.rb that gets created looks like this (the
paypal_error column is shown for context)…


t.column “paypal_amount”, :decimal, :limit => 8, :default =>
#BigDecimal:43fac10,‘0.0’,4(8), :null => false
t.column “paypal_error”, :string

Now when I run rake db:test:prepare, I get errors like the following…

C:/InstantRails-2.0-win/rails_apps/chicago/db/schema.rb:93: syntax
error, unexpe
cted ‘,’, expecting kEND
t.column “paypal_error”, :string

It seems that the “BigDecimal” syntax that rails creates in schema.rb is
not correct, but I’m not sure if I did something wrong or if this is a
bug. I tried recreating schema.rb running rake db:schema:dump, but it
did not help. I’m running Rails 2.1.1 with postgres 8.3.1.

Any help is appreciated.

Thanks,
Keith


#2

On Nov 4, 4:12 am, Keith L. removed_email_address@domain.invalid
wrote:

corresponding line in schema.rb that gets created looks like this (the
paypal_error column is shown for context)…


t.column “paypal_amount”, :decimal, :limit => 8, :default =>
#BigDecimal:43fac10,‘0.0’,4(8), :null => false
t.column “paypal_error”, :string

It’s definitely that default which is wrong. Probably something bust
with the schema dumper.

Fred