On 11/20/06, Dorian Mcfarland
<loaf-1pY2Ax6usr8dnm+yROfE0A@public.gmane.org>
wrote:>
> Hi there,
> I''m trying to a db:schema:load into an empty database(mysql5) and
am having some trouble with timestamps and created_at fields:
>
> t.column "created_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
> t.column "updated_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
>
> when I run the rake task I get:
>
> 13:08:41:rails #> rake db:schema:load --trace
> (in /Users/dorian/Sites/animate/rails)
> ** Invoke db:schema:load (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Execute db:schema:load
> rake aborted!
> ./db/schema.rb:30: parse error, unexpected tCONSTANT, expecting kDO or
''{'' or ''(''
> t.column "created_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
> ^
> ./db/schema.rb:31: parse error, unexpected tCONSTANT, expecting kDO or
''{'' or ''(''
> t.column "updated_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
> ^
> ./db/schema.rb:234: parse error, unexpected tCONSTANT, expecting kDO or
''{'' or ''(''
> t.column "created_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
> ^
> ./db/schema.rb:235: parse error, unexpected tCONSTANT, expecting kDO or
''{'' or ''(''
> t.column "updated_at", :datetime, :default => Sun Jan 01
00:00:00 EST 2006, :null => false
> ^
> ./db/schema.rb:292: parse error, unexpected tCONSTANT, expecting kDO or
''{'' or ''(''
> t.column "timecode", :time, :default => Sat Jan 01
00:00:00 EST 2000
>
>
> these values were already in the schema file and weren''t edited by
me, so I''m not quite sure how that happened.
> Can anyone see what might be wrong?
>
> I''m using rails 1.1.6
>
> thanks
>
> dorian
>
> --
> I do things for love or money
>
> >
>
Dorian,
Try this:
t.column "created_at", :datetime, :default =>
Date.new(2006,1,1).to_time.to_s(:db), :null => false
t.column "updated_at", :datetime, :default =>
Date.new(2006,1,1).to_time.to_s(:db), :null => false
--
Zack Chandler
http://depixelate.com
http://trackplace.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---