def upgrade():
'''
upgrade method
'''
create_table('heartbeats',
sa.Column('executable', sa.String(512)),
sa.Column('hostname', sa.String(128)),
sa.Column('pid', sa.Integer(), autoincrement=False),
sa.Column('thread_id', sa.BigInteger(), autoincrement=False),
sa.Column('thread_name', sa.String(64)),
sa.Column('updated_at', sa.DateTime),
sa.Column('created_at', sa.DateTime))
if context.get_context().dialect.name != 'sqlite':
create_primary_key('heartbeats_pk', 'heartbeats', ['executable', 'hostname', 'pid', 'thread_id'])
create_index('heartbeats_updated_at', 'heartbeats', ['updated_at'])
if context.get_context().dialect.name != 'mysql':
create_check_constraint('heartbeats_created_nn', 'heartbeats', 'created_at is not null')
create_check_constraint('heartbeats_updated_nn', 'heartbeats', 'updated_at is not null')
评论列表
文章目录