Opened 3 years ago

Closed 3 years ago

#21114 closed Bug (fixed)

Migrations must not have a dependency to themself

Reported by: Markus Holtermann Owned by: Markus Holtermann
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


Given two models A and B where B has a FKField pointing to A, the autodetector added a dependency to the migration itself. Thus the migration can never be resolved. This dependency is not even necessary as CreateModel first creates the model A and then B (which can directly point to A)

If additionally A has a FKField to B, the same holds: the first dependency must not contain a dependency to itself while the second (adding the FKField to model A) must depend on the first one.

Change History (2)

comment:1 Changed 3 years ago by Markus Holtermann

Has patch: set
Needs documentation: unset
Needs tests: unset
Owner: set to Markus Holtermann
Patch needs improvement: unset
Status: newassigned

comment:2 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 5a424c2393bf9f2524b8075723e90298c1297846:

Fixed #21114 -- Migrations must not have a dependency to themselves.

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