Friday, June 30, 2017

Re: Database validation error - Even after manage.py flush.

Np man, always glad to help!

Just to seal the case, that happened because django dont edit the migration files itself (well, not through the normal cycle of "makemigrations">"migrate"). You generated a migration with an invalid config, and didnt even mattered if you tried to correct that "default value" and generated another migration, the incorrect migration would still be there.

Another thing that should work would be to generate another migration with the fix for the default value, and use the "squash migrations" feature, which would persist only the most recent/relevant "default value" for that field.

2017-06-30 15:16 GMT-03:00 <pieceofkayk2718@gmail.com>:

Oh dude you are officially my hero!  I didn't even think about the migration files.  That totally worked.  And thank you thank you thank you =D <3.

--
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/c7ce3e4c-157a-48e1-9da1-d6e0bfb86715%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAOs3Lp6yKVTYE4acdRdZgoMu3a8vBbvFq6e56a2PPYZU0A3w9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment