wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Can't specify schema in django settings.py #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm connecting django to an existing db2 database "tempdash" which has some 
existing legacy tables in the "dash" schema. When I run manage.py syncdb (via 
the "tempdash" username) all of the tables get created on the "tempdash" schema 
(since db2 seems to use the current username as the default schema). Also, when 
I run manage.py inspectdb, it only sees the tables on the "tempdash" schema and 
not the "dash" schema.

Ideally, I'd be able to specify the schema inside of the DATABASES dict in 
settings.py. But for now I'm hoping that creating another username ("dash" 
instead of "tempdash") will work and actually get to those tables in the "dash" 
schema.

ps: I'm a newbie to db2, so its possible that I'm misunderstanding schemas in 
some way.

Original issue reported on code.google.com by timm...@gmail.com on 22 Sep 2010 at 7:12

GoogleCodeExporter commented 9 years ago
Generic support of database schema currently not supported by Django . This 
would be supported by Django 1.3 . you can see the ticket raised against this 
on http://code.djangoproject.com/ticket/6148 . 
So, for 'manage.py inspectdb' types of operation you have to wait till Django 
1.3.

For other operation you can use following workaround
Through model meta options you can set db_table metadata to 
'”schema”.”table_name”' 

One solution also available on http://code.djangoproject.com/ticket/6064 

Please let me know if you needs any further clarifications.  

Original comment by rahul.pr...@in.ibm.com on 28 Sep 2010 at 5:54

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 23 Mar 2011 at 12:36