"""add ONU red light / router configure / fiber fault complaint types

Revision ID: 44665fb8ec71
Revises: 9b8f4c2a7d10
Create Date: 2026-08-09

The `complaint_type` column is a native PG enum, so new choices are added by
extending the type itself. Values are appended in PostgreSQL enum order; a
downgrade cannot remove them (PostgreSQL has no DROP VALUE).
"""
from typing import Sequence, Union

from alembic import op


revision: str = '44665fb8ec71'
down_revision: Union[str, None] = '9b8f4c2a7d10'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.execute("ALTER TYPE complaint_type ADD VALUE IF NOT EXISTS 'onu_red_light'")
    op.execute("ALTER TYPE complaint_type ADD VALUE IF NOT EXISTS 'router_configure'")
    op.execute("ALTER TYPE complaint_type ADD VALUE IF NOT EXISTS 'fiber_fault'")


def downgrade() -> None:
    # PostgreSQL cannot drop enum values; once a type member exists it stays.
    pass
