On 07/01/10 10:51, cschand wrote:
How we can create tables for the databases other than default? I have
two databases and the settings are
DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.mysql',
         'NAME': 'dbtest1',
         'USER': 'root',
         'PASSWORD': 'pass',
         'HOST': '',
         'PORT': '',
     },
     'db2': {
         'ENGINE': 'django.db.backends.mysql',
         'NAME': 'dbtest2',
         'USER': 'root',
         'PASSWORD': 'pass',
         'HOST': '',
         'PORT': '',
     }
}

When I run syncdb command it creates tables for default (dbtest1
database) only. How can I create tables for db2? Is it possible to
create at runtime?
There should be a better way than the one I've used.
This should work, rename default to something else, db2 to default
then run syncdb. Finally restore the database names to the original.
Do not use your production copy.

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


Reply via email to