Jan Dittberner
dea15a6c4f
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@242 a67ec6bc-e5d5-0310-a910-815c51eb3124
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
# 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()
|