Opened 11 years ago

Closed 11 years ago

#22204 closed Bug (fixed)

migrations yield CircularDependencyError for simple model

Reported by: Gabe Jackson Owned by: nobody
Component: Migrations Version: dev
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

Description

Here is a simple test project to reproduce the django.db.migrations.graph.CircularDependencyError error:
https://github.com/gabejackson/django-migration-testproject/

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
./manage.py makemigrations

Yields:

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

now run:

./manage.py migrate --list

yields:

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

Change History (2)

comment:1 by gerardo, 11 years ago

Cc: gerardo added

comment:2 by Andrew Godwin <andrew@…>, 11 years ago

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