1
0
Fork 0
gnuviechadmin-historic/testdb/dbschema/gnuviechadmin/versions/2/2.py
Jan Dittberner dea15a6c4f - repository reorganization
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@242 a67ec6bc-e5d5-0310-a910-815c51eb3124
2008-01-12 22:24:08 +00:00

40 lines
1.3 KiB
Python

from sqlalchemy import *
from migrate import *
meta = BoundMetaData(migrate_engine)
client_table = Table(
'client', meta,
Column('clientid', Integer, primary_key = True),
Column('firstname', String(40), nullable = False),
Column('lastname', String(40), nullable = False),
Column('address1', String(40), nullable = False),
Column('address2', String(40)),
Column('country', String(40)),
Column('town', String(50), nullable = False),
Column('zipcode', String(5), nullable = False),
Column('state', String(40)),
Column('active', Boolean, default = False, nullable = False),
Column('phone', String(20)),
Column('mobile', String(20)))
sysuser_table = Table(
'sysuser', meta,
Column('sysuserid', Integer, primary_key = True),
Column('name', String(12), nullable = False),
Column('type', Integer, default = 0, nullable = False),
Column('home', String(128)),
Column('shell', Boolean),
Column('password', String(64)),
Column('clientid', Integer, ForeignKey('client.clientid'),
nullable = False),
Column('toupdate', Boolean, default = False, nullable = False),
Column('md5pass', String(34)),
Column('sysuid', Integer))
def upgrade():
client_table.create()
sysuser_table.create()
def downgrade():
sysuser_table.drop()
client_table.drop()