Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#23341 closed Cleanup/optimization (fixed)

Better stacktrace error for makemigrations when migration references nonexistent migration(s)

Reported by: rsalmaso Owned by: nobody
Component: Migrations Version: 1.7-rc-3
Severity: Normal Keywords:
Cc: raffaele.salmaso@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When makemigrations fails to generate migration graph it raise a KeyError with a message

Dependency references nonexistent parent node %r

It whould be better if it shows even the failinig migration name

Change History (6)

comment:1 Changed 13 months ago by rsalmaso

  • Cc raffaele.salmaso@… added
  • Component changed from Uncategorized to Migrations
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Better stacktrace error for makemigrations to Better stacktrace error for makemigrations when migration references nonexistent migration(s)

comment:2 Changed 13 months ago by rsalmaso

PR against master https://github.com/django/django/pull/3100
PR against 1.7.x https://github.com/django/django/pull/3101

Changed messages from
"Dependency references nonexistent child node %r"
to
"In migration %s dependency references nonexistent child node %r"

and from
"Dependency references nonexistent parent node %r"
to
"In migration %s dependency references nonexistent parent node %r"

comment:3 Changed 13 months ago by timgraham

  • Has patch set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

comment:4 Changed 13 months ago by rsalmaso

Update PR:

  • changed message from "Migration %s dependencies references nonexistent {parent,child} node %r" to "Migration %s dependencies references nonexistent {parent,child} node %r"
  • added tests for missing {parent,child} nodes

For forwards_plan and backwards_plan I'll open a new ticket.

comment:5 Changed 13 months ago by Tim Graham <timograham@…>

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

In abd640fbdfce2c8dc8bca039525694d3a1a0297a:

Fixed #23341 -- Added migration name to nonexistent migration error in makemigrations.

comment:6 Changed 13 months ago by Tim Graham <timograham@…>

In 1a918806ca67e8e4818aeb1c304e4546baab9e4d:

[1.7.x] Fixed #23341 -- Added migration name to nonexistent migration error in makemigrations.

Backport of abd640fbdf from master

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