Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

schema dump corrupts default date

#3399

rake db:schema:dump produces corrupted default date:

t.column "start_date", :date, :default => Sat, 01 Jan 0001, :null => false

'rake db:schema:load' would then error: db/schema.rb:510: syntax error, unexpected tCONSTANT, expecting tASSOC
...:date, :default => Sat, 01 Jan 0001, :null => false

This table was not generated with migrations but imported in from SMF forum. Probably wasn't a great idea.

I have looked in activerecord/lib/active_record/schema_dumper.rb but couldn't come up with a fix.

Reported by Zac Zheng · October 21st, 2009 @ 04:10 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Matt Jones
    Matt Jones

    What version of Rails was this schema dumped from? The only relevant commit that I can find is from August 2006: http://github.com/rails/rails/commit/29ae3e90988a9edf09d85ed32d5aac...

    If you can reproduce this on a more recent version of Rails, it will be much easier to investigate.

    October 26th, 2009 @ 03:45 AM

  2. Zac Zheng
    Zac Zheng

    I have looked at this issue again and it's not a Rails problem.

    The problem was with a really out-of-date spatial_adapter plugin which overwrote the table method used my schema dump, and which didn't output default dates correctly.

    Thanks for the pointer to the schema dump code.

    June 16th, 2010 @ 02:51 PM

  3. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:37 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:37 PM