d616b0a80feb_add_classification_type.py 文件源码

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

项目:ml-annotate 作者: planbrothers 项目源码 文件源码
def upgrade():
    classification_type_enum = postgresql.ENUM('binary', 'multi-label', 'multi-class', name='classification_type_enum')
    classification_type_enum.create(op.get_bind())
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('problem', sa.Column('classification_type', sa.Enum('binary', 'multi-label', 'multi-class', name='classification_type_enum'), server_default='binary', nullable=True))
    op.execute('''
        UPDATE "problem" SET classification_type = 'multi-class' WHERE (SELECT COUNT(*) FROM "problem_label" WHERE problem_id = problem.id) >= 2
    ''')
    # ### end Alembic commands ###
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号