Opened 7 years ago

Last modified 2 years ago

#27844 closed New feature

Add a management command to run the optimizer on a single migration — at Version 1

Reported by: Raphael Gaschignard Owned by: nobody
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: David Wobrock Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Raphael Gaschignard)

Because the migration optimizer still has a bit of trouble with reducing operations, you often want to edit squashed migrations and re-run it through the optimizer.

The attached patch contains an implementation of a management command, optimizemigration, that will help speed up this process.

optimizemigration app_name migration_name reads a single migration, pass it through the optimizer, and then rewrite the result to disk. Unlike squashmigrations, this ignores things like the squashed-ness of the migration.

Change History (2)

by Raphael Gaschignard, 7 years ago

Attachment: optimizemigration.py added

comment:1 by Raphael Gaschignard, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top