Tuesday, January 3, 2017

DateField default value in SQLite and Postgres

I recently set a default value in my local date format on a DateTimeField while I was using SQLite. The migration ran fine on my SQLite dev database, but when trying to apply the migration on my production Postgres database I got an error saying that a default value for DateTimeField must be in the format of 'YYYY-MM-DD'. Wouldn't it be prudent to force users to always specify the default value in the 'YYYY-MM-DD' format to avoid this problem of portability? (Not sure how MySQL handles it)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4f8e0aad-9c6e-45c5-a476-22f604584b0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment