示例#1
0
     'test1-a': {
         'SCHEMA_NAME': 'test1_a',
         'ADDITIONAL_SCHEMAS': ['public'],
     },
     'test1-b': {
         'ADDITIONAL_SCHEMAS': ['public'],
     },
     'test2': {},
     'test3': {},
     'test4': {},
     'test5': {},
 },
 DATABASES=get_databases(
     get_database(
         alias='default',
         override={
             'ENVIRONMENTS': ['default']
         },
         original=DATABASE_DEFAULT),
     get_database(
         alias='db1',
         override={
             'ENGINE': 'django_schemas.backends.postgis.wrapper',
             'ENVIRONMENTS': [
                 'test1-a',
                 'test1-b',
                 'test2',
                 'test3',
                 'test4',
                 'test5',
             ],
         },
示例#2
0
    'PORT': '5432',
    'ENVIRONMENTS': [],
}
"""Sets up the database default template.

This variable doesn't inherently do anything. Instead, we will use
these settings as shortcuts for subsequent databases. See DATABASES...
"""


DATABASES = get_databases(
    
    # Must provide a default database (Django requirement)
    get_database(
        alias='default',
        override={
            'ENVIRONMENTS': ['default']
        },
        original=DATABASE_DEFAULT),
    
    # Primary database connection (for master tables)
    get_database(
        alias='primary',
        override={
            'ENVIRONMENTS': [
                'primary',
            ],
            'HOST': 'localhost',
        },
        replicas=[
            'server1.domain.com',
            'server2.domain.com',