27ae2f102682_.py 文件源码

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

项目:Mailu 作者: Mailu 项目源码 文件源码
def upgrade():
    connection = op.get_bind()
    # spam_threshold is a X/15 based value, we're converting it to percent.
    for user in connection.execute(user_table.select()):
         connection.execute(
            user_table.update().where(
                user_table.c.email == user.email
            ).values(
                spam_threshold=int(100. * float(user.spam_threshold or 0.) / 15.)
            )
         )
    # set default to 80%
    with op.batch_alter_table('user') as batch:
        batch.alter_column('spam_threshold', default=80.)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号