71a34df585ed_migrate_coverage.py 文件源码

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

项目:zeus 作者: getsentry 项目源码 文件源码
def upgrade():
    # we dont retain historical data as we simply dont care yet
    op.execute('truncate table filecoverage')
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('filecoverage', sa.Column(
        'build_id', zeus.db.types.guid.GUID(), nullable=False))
    op.create_index(op.f('ix_filecoverage_build_id'),
                    'filecoverage', ['build_id'], unique=False)
    op.create_unique_constraint('unq_coverage_filname', 'filecoverage', [
                                'build_id', 'filename'])
    op.drop_constraint('unq_job_filname', 'filecoverage', type_='unique')
    op.drop_constraint('filecoverage_job_id_fkey',
                       'filecoverage', type_='foreignkey')
    op.create_foreign_key(None, 'filecoverage', 'build', [
                          'build_id'], ['id'], ondelete='CASCADE')
    op.drop_column('filecoverage', 'job_id')
    # ### end Alembic commands ###
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号