Rake db:test:prepare changing schema on the fly

Hi there,
I’m having trouble loading my schema into the test db. I get:

./db/schema.rb:30: parse error, unexpected tCONSTANT, expecting kDO or
‘{’ or ‘(’
t.column “created_at”, :datetime, :default => Sun Jan 01 00:00:00
+0100 2006, :null => false
^
./db/schema.rb:30: parse error, unexpected tINTEGER, expecting kEND
t.column “created_at”, :datetime, :default => Sun Jan 01 00:00:00
+0100 2006, :null => false

if I remove the default in the schema (or quote it, or do anything with
it) it gets written back again exactly the same way which generates an
error again!

The migration that created that column looks like this:

add_column :films, :created_at, :datetime, :null => false, :default 

=> “2006-01-01 00:00:00”
add_column :films, :updated_at, :datetime, :null => false, :default
=> “2006-01-01 00:00:00”

I’m running round in circles here…
any ideas?

dorian


I do things for love or money

Dorian M. wrote:

Hi there,
I’m having trouble loading my schema into the test db. I get:

./db/schema.rb:30: parse error, unexpected tCONSTANT, expecting kDO or
‘{’ or ‘(’
t.column “created_at”, :datetime, :default => Sun Jan 01 00:00:00
+0100 2006, :null => false
^
./db/schema.rb:30: parse error, unexpected tINTEGER, expecting kEND
t.column “created_at”, :datetime, :default => Sun Jan 01 00:00:00
+0100 2006, :null => false

if I remove the default in the schema (or quote it, or do anything with
it) it gets written back again exactly the same way which generates an
error again!

I assume you’re editing the migration, not the scehma.rb (which will get
autogenerated).

Have you tried :default => Time.now ? ie pass an object rather than a
string ? Wrong date I know, but would verify the Time vs String
question ?

A.