#6148: Add generic support for database schemas
---------------------------------------------------+------------------------
          Reporter:  ikelly                        |         Owner:             
                    
            Status:  new                           |     Milestone:             
                    
         Component:  Database layer (models, ORM)  |       Version:  SVN        
                    
        Resolution:                                |      Keywords:  oracle 
postgresql mysql schemas
             Stage:  Accepted                      |     Has_patch:  1          
                    
        Needs_docs:  0                             |   Needs_tests:  0          
                    
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Comment (by oldium):

 I've just looked at the patch a little bit more and I see problem with
 inconsistently using the schema in table names - there is a problem with
 syncing:

 What is the full list of existing tables? Should it be with the schema in
 the name or without? The problem can be seen in the `syncdb.py` part that
 adds
 {{{
 +                # Add model defined schema tables if anny
 +                if model._meta.db_schema:
 +                    tables +=
 connection.introspection.schema_table_names(model._meta.db_schema)
 }}}
     This adds all tables from the specified schema to the known list of
 tables (but without the schema name). Those tables could be unrelated to
 the DB search path! This is compared to `db_table` (that includes the
 schema) on lines 68-69
 {{{
                 if
 connection.introspection.table_name_converter(model._meta.db_table) in
 tables:
                     continue
 }}}

 The same applies to the `sql.py` part of the patch.

 I also miss the possibility to define global `DATABASE_SCHEMA`.

 There is certainly at least one problem in syncing now. Maybe it is
 possible to fix it easily, but it means to think about it more in depth
 (to have in mind the user specified schema and the DB search path). Maybe
 the only fix is to disallow the per model schema definition and to allow
 only the global one, but as I'm not expert in this area, I might be wrong
 :-)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6148#comment:22>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
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