diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 5 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 5 | ||||
| -rw-r--r-- | docs/topics/cache.txt | 4 | ||||
| -rw-r--r-- | docs/topics/db/multi-db.txt | 15 |
4 files changed, 20 insertions, 9 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 7fb7ec7cad..25d54d5269 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -414,12 +414,17 @@ these changes. * ``django.utils.unittest`` will be removed. +* The ``syncdb`` command will be removed. + * ``django.db.models.signals.pre_syncdb`` and ``django.db.models.signals.post_syncdb`` will be removed, and ``django.db.models.signals.pre_migrate`` and ``django.db.models.signals.post_migrate`` will lose their ``create_models`` and ``created_models`` arguments. +* ``allow_syncdb`` on database routers will no longer automatically become + ``allow_migrate``. + 2.0 --- diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 5bd462b4a8..df2b10d18c 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -52,7 +52,10 @@ but a few of the key features are: :data:`~django.db.models.signals.post_migrate` respectively. The ``create_models``/``created_models`` argument has also been deprecated. -* Routers something something. +* The ``allow_syncdb`` method on database routers is now called ``allow_migrate``, + but still performs the same function. Routers with ``allow_syncdb`` methods + will still work, but that method name is deprecated and you should change + it as soon as possible (nothing more than renaming is required). Admin shortcuts support time zones ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 2352770bad..ea23943c81 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -215,8 +215,8 @@ operations to ``cache_slave``, and all write operations to return 'cache_master' return None - def allow_syncdb(self, db, model): - "Only synchronize the cache model on master" + def allow_migrate(self, db, model): + "Only install the cache model on master" if model._meta.app_label in ('django_cache',): return db == 'cache_master' return None diff --git a/docs/topics/db/multi-db.txt b/docs/topics/db/multi-db.txt index ac329cc4fc..6c74fb944d 100644 --- a/docs/topics/db/multi-db.txt +++ b/docs/topics/db/multi-db.txt @@ -155,14 +155,17 @@ A database Router is a class that provides up to four methods: used by foreign key and many to many operations to determine if a relation should be allowed between two objects. -.. method:: allow_syncdb(db, model) +.. method:: allow_migrate(db, model) - Determine if the ``model`` should be synchronized onto the + Determine if the ``model`` should have tables/indexes created in the database with alias ``db``. Return True if the model should be - synchronized, False if it should not be synchronized, or None if + migrated, False if it should not be migrated, or None if the router has no opinion. This method can be used to determine the availability of a model on a given database. + Note that if this returns ``True`` for an app with migrations but + ``False`` for an app those migrations depend on, Django will error. + A router doesn't have to provide *all* these methods -- it may omit one or more of them. If one of the methods is omitted, Django will skip that router when performing the relevant check. @@ -288,7 +291,7 @@ send queries for the ``auth`` app to ``auth_db``:: return True return None - def allow_syncdb(self, db, model): + def allow_migrate(self, db, model): """ Make sure the auth app only appears in the 'auth_db' database. @@ -328,7 +331,7 @@ from:: return True return None - def allow_syncdb(self, db, model): + def allow_migrate(self, db, model): """ All non-auth models end up in this pool. """ @@ -347,7 +350,7 @@ be queried in the order the are listed in the result, decisions concerning the models in ``auth`` are processed before any other decision is made. If the :setting:`DATABASE_ROUTERS` setting listed the two routers in the other order, -``MasterSlaveRouter.allow_syncdb()`` would be processed first. The +``MasterSlaveRouter.allow_migrate()`` would be processed first. The catch-all nature of the MasterSlaveRouter implementation would mean that all models would be available on all databases. |
