Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23341 closed Cleanup/optimization (fixed)

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

Reported by: Raffaele Salmaso 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 by Raffaele Salmaso, 10 years ago

Cc: raffaele.salmaso@… added
Component: UncategorizedMigrations
Summary: Better stacktrace error for makemigrationsBetter stacktrace error for makemigrations when migration references nonexistent migration(s)

comment:2 by Raffaele Salmaso, 10 years ago

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 by Tim Graham, 10 years ago

Has patch: set
Needs tests: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:4 by Raffaele Salmaso, 10 years ago

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 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In abd640fbdfce2c8dc8bca039525694d3a1a0297a:

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

comment:6 by Tim Graham <timograham@…>, 10 years ago

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