34 lines
1.1 KiB
Python
34 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()
|