"""add score to experiment

Revision ID: 99108bd42b68
Revises: 9a191ae1c27d
Create Date: 2025-12-20 19:15:14.119856

"""

from typing import Sequence, Union

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


# revision identifiers, used by Alembic.
revision: str = "99108bd42b68"
down_revision: Union[str, None] = "9a191ae1c27d"
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.add_column(
        f"{LECRAPAUD_TABLE_PREFIX}_experiments",
        sa.Column("score", sa.Float(), nullable=True),
    )
    op.add_column(
        f"{LECRAPAUD_TABLE_PREFIX}_experiments",
        sa.Column("best_rmse", sa.Float(), nullable=True),
    )
    op.add_column(
        f"{LECRAPAUD_TABLE_PREFIX}_experiments",
        sa.Column("best_logloss", sa.Float(), nullable=True),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column(f"{LECRAPAUD_TABLE_PREFIX}_experiments", "best_logloss")
    op.drop_column(f"{LECRAPAUD_TABLE_PREFIX}_experiments", "best_rmse")
    op.drop_column(f"{LECRAPAUD_TABLE_PREFIX}_experiments", "score")
    # ### end Alembic commands ###
