summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-07-25 09:09:15 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-07-25 09:11:01 -0700
commit2bacc9f3b70e45b172675452b7dd32900fbb8a8b (patch)
tree6c387a680d5e0be654dd10d98b9e761e27f72604
parent6e7e5bacd51d1ab4411c58eea04a137639a0a354 (diff)
[1.7.x] Mark initial_data as deprecated separately from syncdb. Refs #23077.
Conflicts: docs/internals/deprecation.txt
-rw-r--r--django/core/management/commands/loaddata.py6
-rw-r--r--docs/internals/deprecation.txt5
-rw-r--r--docs/releases/1.7.txt3
3 files changed, 14 insertions, 0 deletions
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index a41e433f0a..dca3069ef7 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -18,6 +18,7 @@ from django.utils import lru_cache
from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.utils._os import upath
+from django.utils.deprecation import RemovedInDjango19Warning
from itertools import product
try:
@@ -223,6 +224,11 @@ class Command(BaseCommand):
if fixture_name != 'initial_data' and not fixture_files:
# Warning kept for backwards-compatibility; why not an exception?
warnings.warn("No fixture named '%s' found." % fixture_name)
+ elif fixture_name == 'initial_data':
+ warnings.warn(
+ 'initial_data fixtures are deprecated. Use data migrations instead.',
+ RemovedInDjango19Warning
+ )
return fixture_files
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 065e738920..270c5d4040 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -7,6 +7,7 @@ in a backward incompatible way, following their deprecation, as per the
:ref:`deprecation policy <internal-release-deprecation-policy>`. More details
about each item can often be found in the release notes of two versions prior.
+
.. _deprecation-removed-in-1.9:
1.9
@@ -31,6 +32,10 @@ details on these changes.
* ``allow_syncdb`` on database routers will no longer automatically become
``allow_migrate``.
+* The legacy method of syncing apps without migrations will be removed,
+ and migrations will become compulsory for all apps. This includes automatic
+ loading of ``initial_data`` fixtures and support for initial SQL data.
+
* All models will need to be defined inside an installed application or
declare an explicit :attr:`~django.db.models.Options.app_label`.
Furthermore, it won't be possible to import them before their application
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index 105388fdb7..1b24b87aa8 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -961,6 +961,9 @@ Instead, you are encouraged to load initial data in migrations if you need it
this has the added advantage that your initial data will not need updating
every time you change the schema.
+Additionally, like the rest of Django's old ``syncdb`` code, ``initial_data``
+has been started down the deprecation path and will be removed in Django 1.9.
+
deconstruct() and serializability
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~