summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-07-30 12:08:59 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-07-30 12:08:59 +0100
commit12e9804d163777af17cc2a3dfdfff49e5f750ebd (patch)
treede245c81bba1b8cb8e4cc28b8abd60f8ade5b61e /docs/topics
parent68e0a169c4f9fa7f8071e014b274fd59e970f9a3 (diff)
Rename allow_syncdb to allow_migrate
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/cache.txt4
-rw-r--r--docs/topics/db/multi-db.txt15
2 files changed, 11 insertions, 8 deletions
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.