def upgrade():
'''
upgrade method
'''
create_table('configs',
sa.Column('section', sa.String(128)),
sa.Column('opt', sa.String(128)),
sa.Column('value', sa.String(4000)),
sa.Column('updated_at', sa.DateTime),
sa.Column('created_at', sa.DateTime))
if context.get_context().dialect.name != 'sqlite':
create_primary_key('configs_pk', 'configs', ['section', 'opt'])
create_check_constraint('configs_created_nn', 'configs', 'created_at is not null')
create_check_constraint('configs_updated_nn', 'configs', 'updated_at is not null')
create_table('configs_history',
sa.Column('section', sa.String(128)),
sa.Column('opt', sa.String(128)),
sa.Column('value', sa.String(4000)),
sa.Column('updated_at', sa.DateTime),
sa.Column('created_at', sa.DateTime))
if context.get_context().dialect.name != 'sqlite':
create_primary_key('configs_history_pk', 'configs_history', ['section', 'opt', 'updated_at'])
评论列表
文章目录