Opened 8 years ago

Closed 8 years ago

#27310 closed Cleanup/optimization (fixed)

Refactor RenameModel.state_forwards to avoid relying on state.apps.

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


RenameModel is the only built-in operation to rely on state.apps during state_forwards. Accessing state.apps can trigger model class rendering which is the main cause of slowdown during migration execution.

While I'm aware Markus has been working on making the migration framework completely state.apps agnostic (the only exception being RunPython operations) fixing RenameModel.state_forwards alone seems like a more attainable goal with direct benefits as state_forwards() is meant to be called way more often then database_forwards() in a project lifetime.

Change History (3)

comment:1 by Simon Charette, 8 years ago

Has patch: set

comment:2 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Simon Charette <charette.s@…>, 8 years ago

Resolution: fixed
Status: newclosed

In ecd625e8:

Fixed #27310 -- Stopped rendering apps in RenameModel.state_forwards.

Thanks Tim for the review.

Note: See TracTickets for help on using tickets.
Back to Top