Opened 8 years ago
Closed 8 years ago
#29180 closed Bug (fixed)
makemigrations autodetector ignoring existing migrations
| Reported by: | Collin Anderson | Owned by: | nobody |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Release blocker | Keywords: | |
| Cc: | cmawebsite@…, Collin Anderson, Carlton Gibson | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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)
Change History (6)
comment:1 by , 8 years ago
| Cc: | added |
|---|---|
| Needs tests: | set |
comment:2 by , 8 years ago
| Summary: | Makemigrations autodetector ignoring existing migrations → makemigrations autodetector ignoring existing migrations |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Bug |
comment:3 by , 8 years ago
| Cc: | added |
|---|
comment:4 by , 8 years ago
| Needs tests: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
https://github.com/django/django/pull/9742