Author: russellm
Date: 2010-01-07 05:37:49 -0600 (Thu, 07 Jan 2010)
New Revision: 12116

Modified:
   django/trunk/docs/topics/db/multi-db.txt
Log:
Added docs on how syncdb and other management commands interact with multi-db.

Modified: django/trunk/docs/topics/db/multi-db.txt
===================================================================
--- django/trunk/docs/topics/db/multi-db.txt    2010-01-06 08:16:07 UTC (rev 
12115)
+++ django/trunk/docs/topics/db/multi-db.txt    2010-01-07 11:37:49 UTC (rev 
12116)
@@ -51,6 +51,39 @@
 :setting:`DATABASES` setting then Django will raise a
 ``django.db.utils.ConnectionDoesNotExist`` exception.
 
+Synchronizing your databases
+============================
+
+The :djadmin:`syncdb` management command operates on one database at a
+time. By default, it operates on the ``default`` database, but by
+providing a :djadminopt:`--database` argument, you can tell syncdb to
+synchronize a different database. So - to synchronize all models onto
+all databases in our example, you would need to call::
+
+    $ ./manage.py syncdb
+    $ ./manage.py syncdb --database=users
+
+If you don't want every application to be synchronized onto a
+particular database. you can specify the :djadminopt:`--exclude`
+argument to :djadmin:`syncdb`. The :djadminopt:`--exclude` option
+allows you to prevent a specific application or applications from
+being synchronized. For example, if you don't want the ``sales``
+application to be on the ``users`` database, you could run::
+
+    $ ./manage.py syncdb --database=users --exclude=sales
+
+Alternatively, if you want fine grained control of synchronization,
+you can pipe all or part of the output of :djadmin:`sqlall` for a
+particular application directly into your database prompt.
+
+Using other management commands
+-------------------------------
+
+The other ``django-admin.py`` commands that interact with the database
+operate in the same way as :djadmin:`syncdb` -- they only ever operate
+on one database at a time, using the :djadminopt:`--database` to control
+the database that is used.
+
 Selecting a database for a ``QuerySet``
 =======================================
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to