Opened 21 months ago

Last modified 20 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) (3.1 KB) - added by Raphael Gaschignard 21 months ago.

Download all attachments as: .zip

Change History (3)

Changed 21 months ago by Raphael Gaschignard

Attachment: added

comment:1 Changed 21 months ago by Raphael Gaschignard

Description: modified (diff)

comment:2 Changed 20 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