#22204 closed Bug (fixed)

migrations yield CircularDependencyError for simple model

Reported by: gabejackson Owned by: nobody
Component: Migrations Version: master
Severity: Release blocker Keywords: migrations
Cc: andrewgodwin, 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 Changed 16 months ago by gerardo

  • Cc gerardo added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 16 months ago by Andrew Godwin <andrew@…>

  • Resolution set to fixed
  • Status changed from new to closed

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