"""

Revision ID: c45f5e49fa2c
Revises: db8cdd83563a
Create Date: 2025-06-17 16:52:45.042045

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision: str = "c45f5e49fa2c"
down_revision: Union[str, None] = "db8cdd83563a"
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(
        "datasets", "train_size", existing_type=mysql.INTEGER(), nullable=True
    )
    op.alter_column(
        "datasets", "test_size", existing_type=mysql.INTEGER(), nullable=True
    )
    op.alter_column(
        "datasets", "number_of_groups", existing_type=mysql.INTEGER(), nullable=True
    )
    op.alter_column(
        "datasets", "list_of_groups", existing_type=mysql.JSON(), nullable=True
    )
    op.alter_column(
        "datasets", "start_date", existing_type=mysql.DATETIME(), nullable=True
    )
    op.alter_column(
        "datasets", "end_date", existing_type=mysql.DATETIME(), nullable=True
    )
    op.alter_column(
        "datasets", "train_start_date", existing_type=mysql.DATETIME(), nullable=True
    )
    op.alter_column(
        "datasets", "train_end_date", existing_type=mysql.DATETIME(), nullable=True
    )
    op.alter_column(
        "datasets", "test_start_date", existing_type=mysql.DATETIME(), nullable=True
    )
    op.alter_column(
        "datasets", "test_end_date", existing_type=mysql.DATETIME(), nullable=True
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "datasets", "test_end_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "test_start_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "train_end_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "train_start_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "end_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "start_date", existing_type=mysql.DATETIME(), nullable=False
    )
    op.alter_column(
        "datasets", "list_of_groups", existing_type=mysql.JSON(), nullable=False
    )
    op.alter_column(
        "datasets", "number_of_groups", existing_type=mysql.INTEGER(), nullable=False
    )
    op.alter_column(
        "datasets", "test_size", existing_type=mysql.INTEGER(), nullable=False
    )
    op.alter_column(
        "datasets", "train_size", existing_type=mysql.INTEGER(), nullable=False
    )
    # ### end Alembic commands ###
