Opened 4 years ago

Closed 4 years ago

#22204 closed Bug (fixed)

migrations yield CircularDependencyError for simple model

Reported by: Gabe Jackson Owned by: nobody
Component: Migrations Version: master
Severity: Release blocker Keywords: migrations
Cc: Andrew Godwin, gerardo Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Here is a simple test project to reproduce the django.db.migrations.graph.CircularDependencyError error:

Steps to reproduce:

cd simple_circular_dependency
# Cleanup (note this stuff isn't in the repo)
rm -rf */migrations/*.pyc
rm -rf */migrations/00*
rm db.sqlite3

# Migrations
./ makemigrations


Migrations for 'a':
    - Create model Contact
    - Create model Person
    - Create model Address
    - Create model ShopUserAddress
    - Create model ShopUserContact
    - Create model ShopUserPerson
Migrations for 'b':
    - Create model DeliveryCountry
    - Create model Package

now run:

./ migrate --list


django.db.migrations.graph.CircularDependencyError: [('a', '0001_initial'), ('b', '0001_initial'), ('a', '0001_initial')]

Change History (2)

comment:1 Changed 4 years ago by gerardo

Cc: gerardo added

comment:2 Changed 4 years ago by Andrew Godwin <andrew@…>

Resolution: fixed
Status: newclosed

In e46e15e5a17c1c42d01a343e7044d2d21588493d:

Fixed #22204: Bad circular-dep-breaking if more than one per run

Note: See TracTickets for help on using tickets.
Back to Top