"""test.

Revision ID: 66bdd532bcab
Revises: 6eaf696e07a5
Create Date: 2026-03-18 19:21:14.561568

"""

from __future__ import annotations

from typing import TYPE_CHECKING

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

from python.orm import SignalBotBase

if TYPE_CHECKING:
    from collections.abc import Sequence

# revision identifiers, used by Alembic.
revision: str = "66bdd532bcab"
down_revision: str | None = "6eaf696e07a5"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None

schema = SignalBotBase.schema_name


def upgrade() -> None:
    """Upgrade."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "dead_letter_message",
        "status",
        existing_type=postgresql.ENUM("UNPROCESSED", "PROCESSED", name="message_status", schema=schema),
        type_=sa.Enum("UNPROCESSED", "PROCESSED", name="message_status", native_enum=False),
        existing_nullable=False,
        schema=schema,
    )
    op.alter_column(
        "signal_device",
        "trust_level",
        existing_type=postgresql.ENUM("VERIFIED", "UNVERIFIED", "BLOCKED", name="trust_level", schema=schema),
        type_=sa.Enum("VERIFIED", "UNVERIFIED", "BLOCKED", name="trust_level", native_enum=False),
        existing_nullable=False,
        schema=schema,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "signal_device",
        "trust_level",
        existing_type=sa.Enum("VERIFIED", "UNVERIFIED", "BLOCKED", name="trust_level", native_enum=False),
        type_=postgresql.ENUM("VERIFIED", "UNVERIFIED", "BLOCKED", name="trust_level", schema=schema),
        existing_nullable=False,
        schema=schema,
    )
    op.alter_column(
        "dead_letter_message",
        "status",
        existing_type=sa.Enum("UNPROCESSED", "PROCESSED", name="message_status", native_enum=False),
        type_=postgresql.ENUM("UNPROCESSED", "PROCESSED", name="message_status", schema=schema),
        existing_nullable=False,
        schema=schema,
    )
    # ### end Alembic commands ###
