# Error running rake db:test:prepare

**URL:** <https://www.ruby-forum.com/t/error-running-rake-dbprepare/152456>\
**Category:** Rails\
**Created:** [November 4, 2008, 5:12am UTC](https://www.ruby-forum.com/t/error-running-rake-dbprepare/152456 "2008-11-04T05:12:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klancaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@klancaster](https://www.ruby-forum.com/u/klancaster)\
**Post date:** [November 4, 2008, 5:12am UTC](https://www.ruby-forum.com/t/error-running-rake-dbprepare/152456/1 "2008-11-04T05:12:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![klancaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@klancaster](https://www.ruby-forum.com/u/klancaster)\
**Post date:** [November 4, 2008, 12:31pm UTC](https://www.ruby-forum.com/t/error-running-rake-dbprepare/152456/2 "2008-11-04T12:31:45Z")

</div>

On Nov 4, 4:12 am, Keith L. [removed\_email\_address@domain.invalid](mailto: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
