1
0
Fork 0

add a organization table (addresses #40)

* development.ini:
  - change testing database to PostgreSQL
  - set required database version to 4
 * data/dbrepo/versions/004_Add_organization_table.py:
  - create/drop organization table
  - add organizationid foreign key reference to client table
 * gnuviechadmin/backend/tables.py:
  - add reflected organization_table
This commit is contained in:
Jan Dittberner 2009-08-02 21:01:19 +02:00
parent 33696436a0
commit d4ba46a329
3 changed files with 37 additions and 3 deletions

View file

@ -19,7 +19,7 @@
#
# Version: $Id$
from sqlalchemy import MetaData, Table
from sqlalchemy import MetaData, Table, Column, Unicode
from sqlalchemy.orm import mapper, relation
from sqlalchemy.exceptions import NoSuchTableError
import sys
@ -68,6 +68,11 @@ Trying automatic versioning.""")
dbschema = None
if 'database.schema' in config:
dbschema = config['database.schema']
organization_table = Table(
'organization', meta,
Column('name', Unicode(200)),
schema = dbschema, autoload = True)
(client_table, sysuser_table, domain_table, \
record_table, supermaster_table, mailaccount_table, \