"""Add containment_result to tests.

Revision ID: b052
Revises: b051
Create Date: 2026-06-24
"""
from alembic import op
import sqlalchemy as sa

revision = "b052"
down_revision = "b051"
branch_labels = None
depends_on = None

containment_enum = sa.Enum(
    "contained", "partially_contained", "not_contained",
    name="containmentresult",
)


def upgrade() -> None:
    containment_enum.create(op.get_bind(), checkfirst=True)
    op.add_column(
        "tests",
        sa.Column("containment_result", containment_enum, nullable=True),
    )


def downgrade() -> None:
    op.drop_column("tests", "containment_result")
    containment_enum.drop(op.get_bind(), checkfirst=True)
