"""Added sequence column to chunk table and new enum

Revision ID: 8c50f64287fe
Revises: bbee88729aae
Create Date: 2025-11-21 16:25:42.295645

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '8c50f64287fe'
down_revision: Union[str, Sequence[str], None] = 'bbee88729aae'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('chunk', sa.Column('sequence_number', sa.Integer(), nullable=True))
    op.alter_column('chunk', 'type',
               existing_type=sa.VARCHAR(length=50),
               type_=sa.Enum('TEXT', 'QNA', 'AUGMENTED', name='chunktype', native_enum=False),
               existing_nullable=True)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('chunk', 'type',
               existing_type=sa.Enum('TEXT', 'QNA', 'AUGMENTED', name='chunktype', native_enum=False),
               type_=sa.VARCHAR(length=50),
               existing_nullable=True)
    op.drop_column('chunk', 'sequence_number')
    # ### end Alembic commands ###
