41 lines
1.3 KiB
Python
41 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()
|