Description
Proposed Changes
The sqlmigrate
command fails with errors such as: django.db.migrations.exceptions.NodeNotFoundError: Migration extras.0002_squashed_0059 dependencies reference nonexistent parent node ('dcim', '0002_auto_20160622_1821')
This results from migration squashing where the dependencies
list was not updated to point to the new squashed migrations.
Proposed change is to fix all dependencies
pointers in existing migrations to ensure they point to the existing migrations containing the original (missing) parent nodes.
Justification
Though sqlmigrate
is rarely used (it produces the native SQL operations to be applied during migrations in case they need to be run manually), it is useful as a diagnostic tool and ought to work properly. (Note: migrate
itself does not seem to have this issue.)