#6148: Add generic support for database schemas
-------------------------------------+-------------------------------------
     Reporter:  ikelly               |                    Owner:  akaariai
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Design
     Keywords:  oracle postgresql    |  decision needed
  mysql schemas                      |      Needs documentation:  1
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by akaariai):

 I have done no work on the manage.py sql* commands at all. I am not
 surprised they don't work. But, the foreign key issue seems worrisome. Is
 this from sql* or from the created database? I thought I had nailed the
 issues with foreign keys but I am not that surprised to find out this
 isn't true.

 There are two ways the schemas can collide: between testing and production
 databases, and between two different database aliases both using the same
 schema. So, the "key" for schema must be "in_testing, alias, schema_name".

 I am thinking of something like this as the DATABASES format. Assume there
 are two databases, default and other, and two schemas, schema1 and
 schema2:
 {{{
 DATABASES = {
     'default':{
        ...
     },
     'other': {
        ...
     },
     'default:schema1': {
          # Used in production for default's schema1 schema.
     },
     'default:schema2': {
         ...
     },
     'other:schema1': {
         ...
     },
     'other:schema2: {
         ...
     },
     'test:default:schema1' {
         ...
     },
     ...
 }
 }}}

 Unfortunately this gets large, fast. But, maybe that is how it must be.

 For PostgreSQL the schema aliases would not be needed.

 The routers approach is interesting because one could do some funny things
 with it: the typical example is querying a different schema for different
 clients. Worth investigating more. I know of an immediate use for this, so
 I am interested...

 It is noteworthy that one must be able to do full-db syncs if syncdb
 support is added. There can be circular cross-schema foreign keys, and
 these can not be created before both schemas are created. This is
 impossible to do in single-schema syncs.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/6148#comment:124>
Django <https://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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to