"""v0.13.1 migration

Revision ID: 2fb0ae78dea9
Revises: 4f1a2d63d6dd
Create Date: 2025-07-25 11:51:46.256971

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '2fb0ae78dea9'
down_revision: Union[str, None] = '4f1a2d63d6dd'
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! ###
    op.alter_column('gear', 'gear_type',
               existing_type=sa.INTEGER(),
               comment='Gear type (1 - bike, 2 - shoes, 3 - wetsuit, 4 - racquet, 5 - skis, 6 - snowboard, 7 - windsurf, 8 - water sports board)',
               existing_comment='Gear type (1 - bike, 2 - shoes, 3 - wetsuit, 4 - racquet, 5 - skis, 6 - snowboard, 7 - windsurf)',
               existing_nullable=False)
    # Add the new entry to the migrations table
    op.execute("""
    INSERT INTO migrations (id, name, description, executed) VALUES
    (5, 'v0.13.1', 'Fix users and activity_media photo path', false);
    """)
    # ### end Alembic commands ###


def downgrade() -> None:
    # Remove the entry from the migrations table
    op.execute("""
    DELETE FROM migrations 
    WHERE id = 5;
    """)
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('gear', 'gear_type',
               existing_type=sa.INTEGER(),
               comment='Gear type (1 - bike, 2 - shoes, 3 - wetsuit, 4 - racquet, 5 - skis, 6 - snowboard, 7 - windsurf)',
               existing_comment='Gear type (1 - bike, 2 - shoes, 3 - wetsuit, 4 - racquet, 5 - skis, 6 - snowboard, 7 - windsurf, 8 - water sports board)',
               existing_nullable=False)
    # ### end Alembic commands ###
