"""Add vulnerabilities.package_vendor

Revision ID: 038
Revises: 037
Create Date: 2026-07-23 12:00:00.000000

Vendor/publisher of the affected software, now that it is actually read from
the sources that carry it: Wazuh syscollector (vendor), Intune detectedApps
(publisher), Defender TVM (softwareVendor). Display-only; helps disambiguate
same-named products from different vendors.

Idempotent.
"""
from alembic import op


revision = "038"
down_revision = "037"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.execute("ALTER TABLE vulnerabilities ADD COLUMN IF NOT EXISTS package_vendor VARCHAR(255) NULL;")


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