def upgrade():
### commands auto generated by Alembic - please adjust! ###
question_types = op.create_table('question_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(question_types,
[
{'name':'standard'},
{'name':'image'}
]
)
op.add_column(u'question', sa.Column('question_type_id', sa.Integer(), nullable=False, server_default="1"))
op.create_foreign_key('fk_quesion_question_types', 'question', 'question_types', ['question_type_id'], ['id'])
### end Alembic commands ###
26ef95fc6f2c_add_question_type.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录