This project is archived and is in readonly mode.

#3399 ✓stale
Zac Zheng

schema dump corrupts default date

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

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.

Comments and changes to this ticket

  • Matt Jones

    Matt Jones October 26th, 2009 @ 03:45 AM

    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.

  • Zac Zheng

    Zac Zheng June 16th, 2010 @ 02:51 PM

    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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:37 PM

    • 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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:37 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages