#22788: Custom migration operations are rewritten incorrectly
----------------------------+--------------------
Reporter: schinckel | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
I've written a custom migration operation, and was in the process of
writing a management command to write a migration file, using the
MigrationWriter class.
It's almost all perfect, except that the MigrationWriter class assumes
that the migration operation will be in django.db.migrations:
https://github.com/django/django/blob/master/django/db/migrations/writer.py#L47
I suspect that the MigrationWriter will also be used for things like
squashing migrations, so this problem may appear with custom migration
operations then.
I suggest that it should inspect the migration operation, and if it's not
in the `django.db.migrations` module, add the relevant module to the
imports, and use the correct path for the operation.
--
Ticket URL: <https://code.djangoproject.com/ticket/22788>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.c23110d89d856fbb4d9e7de117b6f051%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.