Opened 3 years ago

Closed 3 years ago

#21114 closed Bug (fixed)

Migrations must not have a dependency to themself

Reported by: MarkusH Owned by: MarkusH
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 MarkusH

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner set to MarkusH
  • Patch needs improvement unset
  • Status changed from new to assigned

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

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

In 5a424c2393bf9f2524b8075723e90298c1297846:

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

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