"""Add remediation column to vulnerabilities (Nessus solution text)

Revision ID: 030
Revises: 029
Create Date: 2026-06-04 09:00:00.000000

Tester feature: Nessus scan results already carry a per-finding
remediation ("solution") text. It was only being appended into the
description blob — surface it in its own column so the CVE detail page can
render a dedicated "Remediation" section below the affected package.

Idempotent — ADD COLUMN IF NOT EXISTS.
"""
from alembic import op


revision = "030"
down_revision = "029"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.execute("""
        ALTER TABLE vulnerabilities
            ADD COLUMN IF NOT EXISTS remediation TEXT;
    """)


def downgrade() -> None:
    op.execute("""
        ALTER TABLE vulnerabilities
            DROP COLUMN IF EXISTS remediation;
    """)
