mirror of
https://github.com/django/django.git
synced 2025-08-02 01:53:15 +00:00
[1.7.x] Fixed #22444 -- Marked initial SQL/fixture loading as deprecated.
Thanks Karen Tracey for the report.
Backport of a4acb80463
from master
This commit is contained in:
parent
548acd77fd
commit
22cbaea9c7
3 changed files with 20 additions and 7 deletions
|
@ -77,6 +77,13 @@ again, you'll wipe out any changes you've made.
|
|||
Automatically loading initial data fixtures
|
||||
-------------------------------------------
|
||||
|
||||
.. deprecated:: 1.7
|
||||
|
||||
If an application uses migrations, there is no automatic loading of
|
||||
fixtures. Since migrations will be required for applications in Django 1.9,
|
||||
this behavior is considered deprecated. If you want to load initial data
|
||||
for an app, consider doing it in a migration.
|
||||
|
||||
If you create a fixture named ``initial_data.[xml/yaml/json]``, that fixture will
|
||||
be loaded every time you run :djadmin:`migrate`. This is extremely convenient,
|
||||
but be careful: remember that the data will be refreshed *every time* you run
|
||||
|
@ -103,6 +110,13 @@ directories.
|
|||
Providing initial SQL data
|
||||
==========================
|
||||
|
||||
.. deprecated:: 1.7
|
||||
|
||||
If an application uses migrations, there is no loading of initial SQL data
|
||||
(including backend-specific SQL data). Since migrations will be required
|
||||
for applications in Django 1.9, this behavior is considered deprecated.
|
||||
If you want to use initial SQL for an app, consider doing it in a migration.
|
||||
|
||||
Django provides a hook for passing the database arbitrary SQL that's executed
|
||||
just after the CREATE TABLE statements when you run :djadmin:`migrate`. You can
|
||||
use this hook to populate default records, or you could also create SQL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue