Jan Dittberner
09180938f1
* make code PEP8 clean (addresses #18) * add copyright information to all python files git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@257 a67ec6bc-e5d5-0310-a910-815c51eb3124
42 lines
1.3 KiB
Python
42 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()
|