#35707: Squash migrations in django.contrib.auth for better performance and
nicer
output
-------------------------------------+-------------------------------------
Reporter: Tim Abbott | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: contrib.auth | Version: 5.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Klaas van Schelven):
My 2c:
I agree with the usefulness of this (speed, cleanup).
In principle, I would say this is _not_ (or should not be) a breaking
change _at all_. Given how squashmigrations work, the replacing migration
"should just take over when it can". Notes on some questions:
* Indeed, the original migrations should not be deleted. In the general
case Django recommends "Once you’ve squashed [..] distribute this change
to all running instances of your application, making sure that they run
migrate to store the change in their database." but this is infeasible and
undesirable in the general case.
* When new auth migrations after the squashed migration are created, they
should depend on the new migration, because in the general case it has the
longest life-expectancy. In my experience Django does this correctly, but
I didn't see this documented. Other than the life-expectancy, it shouldn't
matter in principle: one migration is declared to be a valid replacement
of a set of others, so they should be interchangeable.
In general, I'd like to point out that any doubts raised in the above are
really doubts about Django's squashmigration machinery, which (though
there are surely bugs) in principle works well, and should equally work
well for Django's own migrations.
--
Ticket URL: <https://code.djangoproject.com/ticket/35707#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070194cdacd79b-605e7451-8bb3-4e87-904c-fec42b449fca-000000%40eu-central-1.amazonses.com.