"""Lie les tâches préventives aux entreprises et contrats."""
from alembic import op
import sqlalchemy as sa
revision = "fc3d4e5f6a7b"
down_revision = "fb2c3d4e5f6a"
branch_labels = None
depends_on = None
def upgrade():
    op.add_column("lot_tasks", sa.Column("company_id", sa.Integer(), sa.ForeignKey("companies.id"), nullable=True))
    op.add_column("lot_tasks", sa.Column("contract_id", sa.Integer(), sa.ForeignKey("contracts.id"), nullable=True))
    op.add_column("scheduled_tasks", sa.Column("contract_id", sa.Integer(), sa.ForeignKey("contracts.id"), nullable=True))
def downgrade():
    op.drop_column("scheduled_tasks", "contract_id"); op.drop_column("lot_tasks", "contract_id"); op.drop_column("lot_tasks", "company_id")
