ba876df394c5_.py 文件源码

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

项目:mensa-tracker 作者: annyanich 项目源码 文件源码
def upgrade():
    # batch_alter_table() is necessary here because SQLite does not support
    # the SQL ALTER statement which would normally be emitted here.

    # What this function does is basically cause all the data in the old
    # version of the table to be copied into a new table, then delete the old
    # table at the end if everything works as planned.
    with op.batch_alter_table('menu_entries') as batch_op:
        batch_op.create_unique_constraint(
            constraint_name="unique_menu_entry_date_mensa_category_description",
            columns=['date_valid', 'mensa', 'category', 'description'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号