Saturday, August 1, 2015

Question about squashing django migrations

Hi everyone,

Can someone please explain the implications of this note about squashing migrations in the documentation?

From: https://docs.djangoproject.com/en/1.7/topics/migrations/

"Once you've squashed a migration, you should not then re-squash that squashed migration until you have fully transitioned it to a normal migration."

 Is there a transition command to convert a squashed migration into a normal migration, or how should I go about this?

Here is my current migration situation:

Migrations:
  • 0001_initial.py
  • ...
  • 0052_auto_20150711_1407.py
have been squashed into:
  • 0001_squashed_0052_auto_20150711_1407.py
Since then, I have created further migrations:
  • 0002_auto_20150731_0651.py
  • 0003_auto_20150731_0659.py
I was a little surprised that the numbering continued from 0002 and not 0053. I am concerned that I will become confused with the overlapping numbering before/after the squash so I would like to streamline things a little. I'm ok to remove the first set of migrations 0001 to 0052 as they are correctly captured by the first squash.

What are your recommendations in a case like this?

Thanks!
Richard Brockie



--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/36250ba9-e077-48c9-b92c-6ca45f983400%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment