"""changes-type-of-session-id

Revision ID: 3d84bc32c8ee
Revises: f5c4562bcd86
Create Date: 2024-05-21 17:01:09.577057

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '3d84bc32c8ee'
down_revision: Union[str, None] = 'f5c4562bcd86'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    # Create enum type first
    pipeline_type_enum = sa.Enum('RAG', 'SUMMARIZER', 'DEFAULT' , name='pipelinetypemaster')
    pipeline_type_enum.create(op.get_bind())

    # Add the column using the new enum type
    op.add_column('pipelines', sa.Column('type', pipeline_type_enum, nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    # Drop the column first
    op.drop_column('pipelines', 'type')

    # Drop the enum type
    pipeline_type_enum = sa.Enum('RAG', 'SUMMARIZER', name='pipelinetypemaster')
    pipeline_type_enum.drop(op.get_bind())
    # ### end Alembic commands ###