"""Change notification channel_type from enum to string

Revision ID: b55309328455
Revises: ffcf0ed13a25
Create Date: 2025-11-06 21:32:28.170707

"""

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

# revision identifiers, used by Alembic.
revision = "b55309328455"
down_revision = "ffcf0ed13a25"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "notification_channels",
        "channel_type",
        existing_type=postgresql.ENUM("WEBHOOK", name="notificationchanneltype"),
        type_=sa.String(length=64),
        existing_nullable=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "notification_channels",
        "channel_type",
        existing_type=sa.String(length=64),
        type_=postgresql.ENUM("WEBHOOK", name="notificationchanneltype"),
        existing_nullable=False,
    )
    # ### end Alembic commands ###
