[Django] #28351: "Conflicting migrations detected" CommandError due to replacement Migration being removed

22 views
Skip to first unread message

Django

unread,
Jun 30, 2017, 9:02:57 AM6/30/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-----------------------------------------+------------------------
Reporter: Daniel Hahler | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
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 |
-----------------------------------------+------------------------
I am getting the following error:
{{{
CommandError: Conflicting migrations detected; multiple leaf nodes in the
migration graph: (0002_initial_models, 0XXX_merge_20170628_1435 in myapp).
To fix them run 'python manage.py makemigrations --merge'
}}}

Running the command results in `No conflicts detected to merge.` however.

`0002_initial_models` is not actually a leaf node, but `0003_initial_data`
depends on it.
`0003_initial_data` however is removed, since it replaces
`0XXX_merge_20170628_1435`, which is not applied yet and therefore also
does not show up in `showmigrations`?!
(it gets removed in
https://github.com/django/django/blob/a6756195c1a11eee10c16c96fe95d52e22e1d9ba/django/db/migrations/graph.py#L252)

I think `0003_initial_data` should still show up in `showmigrations`, but
with some indication that it replaces other migrations.
That would happen in case it wasn't removed as a leaf node in
https://github.com/django/django/blob/a6756195c1a11eee10c16c96fe95d52e22e1d9ba/django/core/management/commands/showmigrations.py#L82-L83.

--
Ticket URL: <https://code.djangoproject.com/ticket/28351>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 30, 2017, 10:12:07 AM6/30/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+--------------------------------------

Reporter: Daniel Hahler | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
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
-------------------------------+--------------------------------------

Comment (by Tim Graham):

Can you provide more explicit steps to reproduce the problematic
situation?

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

Django

unread,
Jun 30, 2017, 10:58:31 AM6/30/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+--------------------------------------

Reporter: Daniel Hahler | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
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
-------------------------------+--------------------------------------

Comment (by Daniel Hahler):

Not currently.

I think a fix might be to move over the `replaces` from the node that gets
replaced, and/or only to replace up to the parent that got applied in
https://github.com/django/django/blob/a6756195c1a11eee10c16c96fe95d52e22e1d9ba/django/db/migrations/graph.py#L243-L245.

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

Django

unread,
Jun 30, 2017, 1:57:34 PM6/30/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+------------------------------------

Reporter: Daniel Hahler | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
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 Tim Graham):

* stage: Unreviewed => Accepted


Comment:

Tentatively accepting. Might be difficult to proceed without steps to
reproduce unless you plan to offer a patch.

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

Django

unread,
Jul 4, 2017, 9:42:56 PM7/4/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+----------------------------------------
Reporter: Daniel Hahler | Owner: Windson yang
Type: Bug | Status: assigned
Component: Migrations | Version: 1.11

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 Windson yang):

* status: new => assigned
* owner: nobody => Windson yang


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

Django

unread,
Aug 8, 2017, 4:35:04 AM8/8/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+----------------------------------------
Reporter: Daniel Hahler | Owner: Windson yang
Type: Bug | Status: assigned
Component: Migrations | Version: 1.11

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
-------------------------------+----------------------------------------

Comment (by Windson yang):

I need more details to fix this bug.

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

Django

unread,
Aug 12, 2017, 9:00:35 PM8/12/17
to django-...@googlegroups.com
#28351: "Conflicting migrations detected" CommandError due to replacement Migration
being removed
-------------------------------+----------------------------------------
Reporter: Daniel Hahler | Owner: Windson yang
Type: Bug | Status: closed
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: needsinfo
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 Tim Graham):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/28351#comment:6>

Reply all
Reply to author
Forward
0 new messages