"""change name column

Revision ID: 8b11c1ba982e
Revises: c36e9fee22b9
Create Date: 2025-08-28 16:22:45.528296

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from lecrapaud.config import LECRAPAUD_TABLE_PREFIX

# revision identifiers, used by Alembic.
revision: str = "8b11c1ba982e"
down_revision: Union[str, None] = "c36e9fee22b9"
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(
        f"{LECRAPAUD_TABLE_PREFIX}_experiments",
        "name",
        existing_type=mysql.VARCHAR(length=50),
        type_=sa.String(length=255),
        existing_nullable=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        f"{LECRAPAUD_TABLE_PREFIX}_experiments",
        "name",
        existing_type=sa.String(length=255),
        type_=mysql.VARCHAR(length=50),
        existing_nullable=False,
    )
    # ### end Alembic commands ###
