Opened 7 months ago

Last modified 7 months ago

#27844 assigned New feature

Add a management command to optimize a migration

Reported by: Raphael Gaschignard Owned by: nobody
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes 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.

Attachments (1)

optimizemigration.py (3.1 KB) - added by Raphael Gaschignard 7 months ago.

Download all attachments as: .zip

Change History (3)

Changed 7 months ago by Raphael Gaschignard

Attachment: optimizemigration.py added

comment:1 Changed 7 months ago by Raphael Gaschignard

Description: modified (diff)

comment:2 Changed 7 months ago by Tim Graham

Needs documentation: set
Needs tests: set
Summary: Add a management command to run the optimizer on a single migrationAdd a management command to optimize a migration
Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top