232c38fec944_service_host_many_to_many.py 文件源码

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

项目:kostyor 作者: Mirantis 项目源码 文件源码
def upgrade():
    op.create_table(
        'hosts_services',
        sa.Column('host_id', sa.String(36), sa.ForeignKey('hosts.id')),
        sa.Column('service_id', sa.String(36), sa.ForeignKey('services.id')),
        sa.UniqueConstraint('host_id', 'service_id'))

    with op.batch_alter_table('services') as batch_op:
        batch_op.drop_constraint('fk_services_host_id_hosts')
        batch_op.drop_column('host_id')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号