Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#22444 closed Bug (fixed)

conflicting docs regarding initial_data loading

Reported by: kmtracey Owned by: nobody
Component: Documentation Version: 1.7-beta-1
Severity: Release blocker Keywords:
Cc: timo Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

https://docs.djangoproject.com/en/dev/releases/1.7/#schema-migrations states "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."

However https://docs.djangoproject.com/en/1.7/howto/initial-data/#automatically-loading-initial-data-fixtures states: "If you create a fixture named initial_data.[xml/yaml/json], that fixture will be loaded every time you run migrate. This is extremely convenient, but be careful: remember that the data will be refreshed every time you run migrate. So don’t use initial_data for data you’ll want to edit."

I'm assuming, given the first statement in the release notes, that the 2nd only applies to applications without migrations? That 2nd citation needs to be updated to make it clear that this ONLY applies to apps without migrations (which may come across rather oddly...run migrate to load your initial data for apps w/out migrations...but I assume that IS the case?)

Attachments (1)

22444.diff (881 bytes) - added by timo 13 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 13 months ago by bmispelon

  • Easy pickings set
  • Triage Stage changed from Unreviewed to Accepted

Just did a quick test and indeed, the fixture is not installed if the app uses migrations but it gets installed if the migrations folder is removed.

Changed 13 months ago by timo

comment:2 Changed 13 months ago by timo

  • Cc timo added
  • Has patch set

comment:3 Changed 13 months ago by timo

I believe "Providing initial SQL data" should also be marked as deprecated for the same reasons.

comment:4 Changed 13 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In a4acb804634af17cfd9ee7070ec3865d7cc2a7a3:

Fixed #22444 -- Marked initial SQL/fixture loading as deprecated.

Thanks Karen Tracey for the report.

comment:5 Changed 13 months ago by Tim Graham <timograham@…>

In 22cbaea9c7f3eeeda4a8570278910f879449ddb9:

[1.7.x] Fixed #22444 -- Marked initial SQL/fixture loading as deprecated.

Thanks Karen Tracey for the report.

Backport of a4acb80463 from master

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