Forum: Ruby on Rails schema dump corrupts date defaults in mysql

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matthew B. (Guest)
on 2006-03-29 19:43
(Received via mailing list)
Hey, looks pretty messy out here the last two days...so please let me
know
if this is known, or if you can confirm.

Just upped to Rails 1.1.  When I run `rake test` I get:

rake aborted!
./db/schema.rb:17: parse error, unexpected kEND
./db/schema.rb:21: parse error, unexpected $, expecting kEND

(See full trace by running task with --trace)

Uggly.  In schema.rb:
 t.column "valid_until", :date, :default => #<Date: 4976867/2,0,2299161>

Whoa, an object ID? that can't be right....and if I change schema.rb to
a
string, rake re-writes the damn thing before running the tests anyway.
Is
this confirmed/disprooved?  Is it something I may be doing wrong?

The rake --trace follows, thank all.

--
Matthew B. :: 607 227 0871
Resume & Portfolio @ http://madhatted.com


** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:test:prepare
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
** Execute db:test:clone
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
./db/schema.rb:17: parse error, unexpected kEND
./db/schema.rb:21: parse error, unexpected $, expecting kEND
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:129:in
`load'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:129:in
`load'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:31
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:71
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:138
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:209:in
`invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:844:in
`each'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:208:in
`invoke_prerequisites'/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:201:in
`invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/testing.rake:28
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke'
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7
/usr/bin/rake:18
jfmiller (Guest)
on 2006-03-29 23:14
I'm having simular issuse with the generation of `schema.rb`.  for me it
is changing double columns to floats.
This topic is locked and can not be replied to.