"""add level range to route encounters

Revision ID: 9afcbafe9888
Revises: 694df688fb02
Create Date: 2026-02-05 13:32:35.559499

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '9afcbafe9888'
down_revision: Union[str, Sequence[str], None] = '694df688fb02'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    op.add_column('route_encounters', sa.Column('min_level', sa.SmallInteger(), nullable=False, server_default='0'))
    op.add_column('route_encounters', sa.Column('max_level', sa.SmallInteger(), nullable=False, server_default='0'))
    op.alter_column('route_encounters', 'min_level', server_default=None)
    op.alter_column('route_encounters', 'max_level', server_default=None)


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('route_encounters', 'max_level')
    op.drop_column('route_encounters', 'min_level')
    # ### end Alembic commands ###
