def upgrade():
### commands auto generated by Alembic - please adjust! ###
voting_types = op.create_table('voting_types',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=25), nullable=False),
sa.PrimaryKeyConstraint('id')
)
### Populate with question types
op.bulk_insert(voting_types,
[
{'name':'triangle'},
{'name':'linear'}
]
)
op.add_column(u'question', sa.Column('voting_type_id', sa.Integer(), nullable=False, server_default="1"))
op.create_foreign_key('fk_quesion_voting_types', 'question', 'voting_types', ['voting_type_id'], ['id'])
### end Alembic commands ###
2fe1ed8ce31c_add_voting_type.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录