#27844: Add a management command to optimize a migration
-------------------------------------+-------------------------------------
Reporter: Raphael Gaschignard | Owner: David
| Wobrock
Type: New feature | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Wobrock):
* cc: David Wobrock (added)
* needs_docs: 1 => 0
* owner: nobody => David Wobrock
* needs_tests: 1 => 0
Comment:
Hi there,
Reviving this ticket, I think this command could be quite useful,
especially when you upgrade Django on older projects, and new migration
optimizations were added since.
I submitted a PR inspired by the attached patch.
[https://github.com/django/django/pull/15272 PR]
I made a quite specific choice for the logic of the command. By default,
it overwrites the named migration. But if some manual porting is required,
it will rather try to create a replacement migration. My thought was that,
if functions need manual porting, we don't want to lose the code by
overwriting the migration file.
Tell me what you think of this :)
--
Ticket URL: <https://code.djangoproject.com/ticket/27844#comment:3>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.c1b54e60e42c6fc72252d1686302c927%40djangoproject.com.