Opened 9 years ago
Closed 9 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 |
Description
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 , 9 years ago
| Has patch: | set |
|---|
comment:2 by , 9 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
PR