2008-01-12 23:24:08 +01:00
|
|
|
# setup tables for spamassassin
|
|
|
|
from sqlalchemy import *
|
|
|
|
from migrate import *
|
|
|
|
|
|
|
|
meta = BoundMetaData(migrate_engine)
|
|
|
|
domains = Table('domains', meta, autoload = True)
|
|
|
|
mailalias = Table(
|
|
|
|
'mailalias', meta,
|
2008-06-06 21:20:18 +02:00
|
|
|
Column('mailaliasid', Integer, primary_key = True),
|
2008-01-12 23:24:08 +01:00
|
|
|
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))
|
|
|
|
|
2008-06-06 21:20:18 +02:00
|
|
|
|
2008-01-12 23:24:08 +01:00
|
|
|
def upgrade():
|
|
|
|
mailalias.create()
|
|
|
|
mailpassword.create()
|
|
|
|
|
2008-06-06 21:20:18 +02:00
|
|
|
|
2008-01-12 23:24:08 +01:00
|
|
|
def downgrade():
|
|
|
|
mailpassword.drop()
|
|
|
|
mailalias.drop()
|