﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29180	makemigrations autodetector ignoring existing migrations	Collin Anderson	nobody	"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)
}}}

    
"	Bug	closed	Migrations	dev	Release blocker	fixed		cmawebsite@… Collin Anderson Carlton Gibson	Ready for checkin	1	0	0	0	0	0
