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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dorian Mcfarland 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. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---