[Django] #24755: makemigrations --merge output is confusing when one head has a dependency to another app

17 views
Skip to first unread message

Django

unread,
May 5, 2015, 6:51:13 PM5/5/15
to django-...@googlegroups.com
#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.

Django

unread,
May 5, 2015, 6:52:43 PM5/5/15
to django-...@googlegroups.com
#24755: makemigrations --merge output is confusing when one head depends on another
app
----------------------------+--------------------------------------

Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/24755#comment:1>

Django

unread,
May 5, 2015, 7:05:11 PM5/5/15
to django-...@googlegroups.com
#24755: makemigrations --merge output is confusing when one head depends on another
app
----------------------------+------------------------------------

Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24755#comment:2>

Django

unread,
Aug 9, 2015, 9:58:02 AM8/9/15
to django-...@googlegroups.com
#24755: makemigrations --merge output is confusing when one head depends on another
app
----------------------------+------------------------------------
Reporter: carljm | Owner: MarkusH
Type: Bug | Status: assigned
Component: Migrations | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by MarkusH):

* owner: nobody => MarkusH
* status: new => assigned
* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/5121

--
Ticket URL: <https://code.djangoproject.com/ticket/24755#comment:3>

Django

unread,
Aug 11, 2015, 8:32:49 AM8/11/15
to django-...@googlegroups.com
#24755: makemigrations --merge output is confusing when one head depends on another
app
----------------------------+---------------------------------------------

Reporter: carljm | Owner: MarkusH
Type: Bug | Status: assigned
Component: Migrations | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24755#comment:4>

Django

unread,
Aug 18, 2015, 5:37:44 AM8/18/15
to django-...@googlegroups.com
#24755: makemigrations --merge output is confusing when one head depends on another
app
----------------------------+---------------------------------------------
Reporter: carljm | Owner: MarkusH
Type: Bug | Status: closed
Component: Migrations | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------------------------------
Changes (by Markus Holtermann <info@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"0271a11ba5df58b449a3f968ec57fb1a090c5726" 0271a11]:
{{{
#!CommitTicketReference repository=""
revision="0271a11ba5df58b449a3f968ec57fb1a090c5726"
Fixed #24755 -- Hid operations from dependency apps when merging
migrations

Thanks Carl Meyer for the report and Tim Graham for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24755#comment:5>

Reply all
Reply to author
Forward
0 new messages