#23410: Backward migrations change overall state rather than reverting single
migration
-----------------------------+--------------------------------------
Reporter: Markush2010 | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.7
Severity: Normal | Resolution: invalid
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 carljm):
Andrew: I understand the contract you described, and I understand that it
preserves the invariant that the arguments you pass to "migrate" always
specify precisely one database state, regardless of whether you are
migrating forwards or backwards. But I think there is a competing value
here (reducing the risk of data loss inherent in rolling back migrations
that arguably were not requested for rollback), which to me seems a higher
priority than the name-refers-to-single-state invariant.
If I were to describe the ideal behavior precisely, it would be this:
given a request to migrate to "appname 0001", we pick whatever target spot
on the linearized migration plan between "appname 0001" and "appname 0002"
results in the fewest possible migrations from other apps requiring
migrate/rollback. The only guaranteed invariant would be that "appname
0001" refers to a state where "appname 0001" is applied and "appname 0002"
is not, and all dependency constraints are satisfied.
This choice would accept that a name like "appname 0001" is imprecise
rather than precise, but would consider that a reasonable tradeoff in
exchange for behavior that is (arguably?) more intuitive and less likely
to result in data loss.
If you'd rather discuss on the mailing list, I can bring up the question
there.
--
Ticket URL: <https://code.djangoproject.com/ticket/23410#comment:4>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.f14bbdc541b6c399489b846583c36b09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.