#24755: makemigrations --merge output is confusing when one head has a
dependency
to another app
--------------------------------------+------------------------
Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
When you run `makemigrations --merge`, for every app with multiple 'head'
migrations, `makemigrations` lists each head and the operations present
only in its branch. So for instance, if we have an app X which has
migrations `X.0003_a` and `X.0003_b`, both of which depend on `X.0002`,
then `makemigrations --merge` will list the operations present in each of
the two migrations `X.0003_a` and `X.0003_b` so we can verify that they
don't conflict. So far, so good.
However, let's say we have another app Y, with migrations up to `Y.0004`,
and it so happens that `X.0003_b` depends on `Y.0004` (in addition to
depending on `X.0002`).
In this situation, `makemigrations --merge` includes every operation in
every migration of app `Y` in its list of operations that are part of the
`X.0003_b` branch. This is very confusing, as it makes that branch appear
much bigger than it actually is. Despite the dependency, the migrations in
app `Y` are not relevant to determining whether the merge is safe, because
in general it is an assumption of the migrations framework that migrations
in different apps do not conflict with one another (which is we allow one
"head" migration per app, not per project).
I think that `makemigrations --merge` should restrict its search for
operations in each branch to the current app only, and not display
operations from a different app.
--
Ticket URL: <https://code.djangoproject.com/ticket/24755>
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/049.92a3533a1ad3f237c3d44f2998689dbb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.