def upgrade():
'''
upgrade method
'''
create_table('account_attr_map',
sa.Column('account', sa.String(25)),
sa.Column('key', sa.String(255)),
sa.Column('value', sa.String(255)),
sa.Column('updated_at', sa.DateTime),
sa.Column('created_at', sa.DateTime))
if context.get_context().dialect.name != 'sqlite':
create_primary_key('ACCOUNT_ATTR_MAP_PK', 'account_attr_map', ['account', 'key'])
create_check_constraint('ACCOUNT_ATTR_MAP_CREATED_NN', 'account_attr_map', 'created_at is not null')
create_check_constraint('ACCOUNT_ATTR_MAP_UPDATED_NN', 'account_attr_map', 'updated_at is not null')
create_foreign_key('ACCOUNT_ATTR_MAP_ACCOUNT_FK', 'account_attr_map', 'accounts', ['account'], ['account'])
create_index('ACCOUNT_ATTR_MAP_KEY_VALUE_IDX', 'account_attr_map', ['key', 'value'])
4c3a4acfe006_new_attr_account_table.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录