1
0
Fork 0
gnuviechadmin-historic/testdb/dbschema/gnuviechadmin/versions/1/1.py

36 lines
1.1 KiB
Python
Raw Normal View History

# setup tables for spamassassin
from sqlalchemy import *
from migrate import *
meta = BoundMetaData(migrate_engine)
domains = Table('domains', meta, autoload = True)
mailalias = Table(
'mailalias', meta,
Column('mailaliasid', Integer, primary_key = True),
Column('domainid', Integer, ForeignKey('domains.id'), nullable = False),
Column('email', String(255), nullable = False),
Column('target', TEXT, nullable = False),
UniqueConstraint('email', 'domainid'))
mailpassword = Table(
'mailpassword', meta,
Column('id', String(18), primary_key = True),
Column('domainid', Integer, ForeignKey('domains.id'), nullable = False),
Column('uid', Integer, nullable = False),
Column('gid', Integer, nullable = False),
Column('home', String(255), nullable = False),
Column('cryptpass', String(34), nullable = False),
Column('clearpass', String(64), nullable = False),
Column('spamcheck', Boolean, default = False),
Column('sajunkscore', Integer))
def upgrade():
mailalias.create()
mailpassword.create()
def downgrade():
mailpassword.drop()
mailalias.drop()