#23512 closed Cleanup/optimization (fixed)
Make migration docs about initial_data fixtures clearer
Reported by: | Markus Holtermann | Owned by: | Ola Sitarska |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | info+coding@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
From @abhillman on IRC:
When migrations are created in Django 1.7, the fixtures are ignored. This is a perfectly fine decision, but many users (such as myself) still need fixture-like functionality. That functionality is provided by RunPython or RunSQL within a migration. While the release notes correctly indicate that modifying/creating a migration can replace initial_data, they could be a little clearer, noting RunPython or RunSQL. For example:
"initial_data fixtures are no longer loaded for apps with migrations; if you want to load initial data for an app, we suggest you do it in a migration."
... could become
"initial_data fixtures are no longer loaded for apps with migrations; if you want to load initial data for an app, we suggest you create a migration for you application and define a RunPython or RunSQL command in the operations section of the migration."
That could be immensely helpful for pointing users in the right direction, especially if they are eager to quickly get django 1.7 up and running... whilst maintaining fixture-like functionality.
Change History (8)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 10 years ago
comment:4 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Thank you Ola. Looks good to me.
comment:7 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Should also be changed in the 1.7 release notes as described in #23513.