r1083@denkpolster: jan | 2008-04-04 20:36:31 +0200
work on compatibility issues * make gnuviechadmin compatible with (fixes #6) * setup database at startup if necessary (fixes #8) git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@248 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
c049fd9bc9
commit
4ae866c559
7 changed files with 52 additions and 30 deletions
|
@ -2,7 +2,7 @@ from sqlalchemy import *
|
|||
from migrate import *
|
||||
from gnuviechadmin.backend.settings import dbschema
|
||||
|
||||
meta = BoundMetaData(migrate_engine)
|
||||
meta = MetaData(migrate_engine)
|
||||
client = Table(
|
||||
'client', meta,
|
||||
Column('clientid', Integer, primary_key=True),
|
||||
|
@ -29,7 +29,7 @@ sysuser = Table(
|
|||
Column('shell', Boolean, nullable=False, default=False),
|
||||
Column('clearpass', String(64)),
|
||||
Column('md5pass', String(34)),
|
||||
Column('clientid', Integer, ForeignKey("client.clientid"),
|
||||
Column('clientid', Integer, ForeignKey(client.c.clientid),
|
||||
nullable=False),
|
||||
Column('sysuid', Integer, nullable=False, unique=True),
|
||||
Column('lastchange', DateTime, default=func.now()),
|
||||
|
@ -43,14 +43,14 @@ domain = Table(
|
|||
Column('last_check', Integer),
|
||||
Column('type', String(6), nullable=False),
|
||||
Column('notified_serial', Integer),
|
||||
Column('sysuserid', Integer, ForeignKey("sysuser.sysuserid"),
|
||||
Column('sysuserid', Integer, ForeignKey(sysuser.c.sysuserid),
|
||||
nullable=False),
|
||||
schema = dbschema
|
||||
)
|
||||
record = Table(
|
||||
'record', meta,
|
||||
Column('recordid', Integer, primary_key=True),
|
||||
Column('domainid', Integer, ForeignKey("domain.domainid"),
|
||||
Column('domainid', Integer, ForeignKey(domain.c.domainid),
|
||||
nullable=False),
|
||||
Column('name', String(255)),
|
||||
Column('type', String(6)),
|
||||
|
@ -64,7 +64,7 @@ supermaster = Table(
|
|||
'supermaster', meta,
|
||||
Column('ip', String(25), nullable=False),
|
||||
Column('nameserver', String(255), nullable=False),
|
||||
Column('account', Integer, ForeignKey("sysuser.sysuserid"),
|
||||
Column('account', Integer, ForeignKey(sysuser.c.sysuserid),
|
||||
nullable=False),
|
||||
schema = dbschema
|
||||
)
|
||||
|
|
|
@ -2,12 +2,12 @@ from sqlalchemy import *
|
|||
from migrate import *
|
||||
from gnuviechadmin.backend.settings import dbschema
|
||||
|
||||
meta = BoundMetaData(migrate_engine)
|
||||
meta = MetaData(migrate_engine)
|
||||
domain = Table('domain', meta, schema = dbschema, autoload = True)
|
||||
mailaccount = Table(
|
||||
'mailaccount', meta,
|
||||
Column('mailaccountid', Integer, primary_key = True),
|
||||
Column('domainid', Integer, ForeignKey('domain.domainid'),
|
||||
Column('domainid', Integer, ForeignKey(domain.c.domainid),
|
||||
nullable = False),
|
||||
Column('mailaccount', String(12), nullable = False, unique = True),
|
||||
Column('clearpass', String(64)),
|
||||
|
@ -22,7 +22,7 @@ mailaccount = Table(
|
|||
mailaddress = Table(
|
||||
'mailaddress', meta,
|
||||
Column('mailaddressid', Integer, primary_key = True),
|
||||
Column('domainid', Integer, ForeignKey('domain.domainid'),
|
||||
Column('domainid', Integer, ForeignKey(domain.c.domainid),
|
||||
nullable = False),
|
||||
Column('email', String(255), nullable = False),
|
||||
UniqueConstraint('email', 'domainid'),
|
||||
|
@ -31,7 +31,7 @@ mailaddress = Table(
|
|||
mailtarget = Table(
|
||||
'mailtarget', meta,
|
||||
Column('mailtargetid', Integer, primary_key = True),
|
||||
Column('mailaddressid', Integer, ForeignKey('mailaddress.mailaddressid'),
|
||||
Column('mailaddressid', Integer, ForeignKey(mailaddress.c.mailaddressid),
|
||||
nullable = False),
|
||||
Column('target', String(128), nullable = False),
|
||||
UniqueConstraint('target', 'mailaddressid'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue