"""increase key_prefix length to 20

Revision ID: 5f20d93a7606
Revises: e8f9a0b1c2d3
Create Date: 2026-07-08 09:26:45.334724
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

revision: str = '5f20d93a7606'
down_revision: Union[str, None] = 'e8f9a0b1c2d3'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.alter_column('api_keys', 'key_prefix',
               existing_type=sa.VARCHAR(length=10),
               type_=sa.String(length=20),
               existing_nullable=False)


def downgrade() -> None:
    op.alter_column('api_keys', 'key_prefix',
               existing_type=sa.String(length=20),
               type_=sa.VARCHAR(length=10),
               existing_nullable=False)
