[Django] #29180: Makemigrations autodetector ignoring existing migrations

7 views
Skip to first unread message

Django

unread,
Mar 2, 2018, 10:30:37 AM3/2/18
to django-...@googlegroups.com
#29180: Makemigrations autodetector ignoring existing migrations
-------------------------------------------+------------------------
Reporter: Collin Anderson | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
I don't have a minimal case to reproduce this issue, but I've bisected the
issue to a38ae914 (#28996) and narrowed it down to this change:

{{{
diff --git a/django/db/migrations/graph.py b/django/db/migrations/graph.py
index aba8259..db8a529 100644
--- a/django/db/migrations/graph.py
+++ b/django/db/migrations/graph.py
@@ -367,9 +367,7 @@ class MigrationGraph:
plan = []
for node in nodes:
for migration in self.forwards_plan(node):
- if migration not in plan:
- if not at_end and migration in nodes:
- continue
+ if migration in plan or at_end or migration not in nodes:
plan.append(migration)
project_state = ProjectState(real_apps=real_apps)
for node in plan:
}}}

I think believe the correct logic should be:

{{{
if migration not in plan and (at_end or migration not in nodes):
plan.append(migration)
}}}

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

Django

unread,
Mar 2, 2018, 10:35:14 AM3/2/18
to django-...@googlegroups.com
#29180: Makemigrations autodetector ignoring existing migrations
---------------------------------+--------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: master
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Collin Anderson):

* cc: Collin Anderson (added)
* needs_tests: 0 => 1


Comment:

https://github.com/django/django/pull/9742

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

Django

unread,
Mar 2, 2018, 11:09:56 AM3/2/18
to django-...@googlegroups.com
#29180: makemigrations autodetector ignoring existing migrations
---------------------------------+------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted
* type: Uncategorized => Bug


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

Django

unread,
Mar 5, 2018, 6:04:02 AM3/5/18
to django-...@googlegroups.com
#29180: makemigrations autodetector ignoring existing migrations
---------------------------------+------------------------------------
Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master

Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Carlton Gibson):

* cc: Carlton Gibson (added)


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

Django

unread,
Mar 8, 2018, 3:45:19 AM3/8/18
to django-...@googlegroups.com
#29180: makemigrations autodetector ignoring existing migrations
-------------------------------------+-------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Release blocker | 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 Carlton Gibson):

* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


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

Django

unread,
Mar 9, 2018, 3:32:15 AM3/9/18
to django-...@googlegroups.com
#29180: makemigrations autodetector ignoring existing migrations
-------------------------------------+-------------------------------------
Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master

Severity: Release blocker | 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
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"4d420a53cf9796ce635d16f6832b6c5f1bb7dc8a" 4d420a53]:
{{{
#!CommitTicketReference repository=""
revision="4d420a53cf9796ce635d16f6832b6c5f1bb7dc8a"
Refs #29180 -- Added MigrationGraph._generate_plan() for testing.
}}}

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

Django

unread,
Mar 9, 2018, 3:32:15 AM3/9/18
to django-...@googlegroups.com
#29180: makemigrations autodetector ignoring existing migrations
-------------------------------------+-------------------------------------
Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: master
Severity: Release blocker | 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 Carlton Gibson <carlton.gibson@…>):

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


Comment:

In [changeset:"5b083a824ea90fb1705bd0c208245ff92a5237d8" 5b083a82]:
{{{
#!CommitTicketReference repository=""
revision="5b083a824ea90fb1705bd0c208245ff92a5237d8"
Fixed #29180 -- Fixed a regression where migrations already in the plan
were readded.

Regression in a38ae914d89809aed6d79337b74a8b31b6d3849a.
}}}

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

Reply all
Reply to author
Forward
0 new messages