"""add short_id column to images

Revision ID: 003
Revises: 002
Create Date: 2026-05-09
"""

from alembic import op
import sqlalchemy as sa

revision = "003"
down_revision = "002"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column("images", sa.Column("short_id", sa.String(8), nullable=True))
    op.create_index("ix_images_short_id", "images", ["short_id"], unique=True)


def downgrade() -> None:
    op.drop_index("ix_images_short_id", table_name="images")
    op.drop_column("images", "short_id")
