2fe1ed8ce31c_add_voting_type.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:vilfredo-core 作者: fairdemocracy 项目源码 文件源码
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 ###
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号