"""add ability to disable ce

Revision ID: b635f502f44f
Revises: aeea38580473
Create Date: 2026-01-06 11:33:09.766763

"""

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "b635f502f44f"
down_revision = "aeea38580473"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    # Add column as nullable first
    op.add_column("continuous_evals", sa.Column("enabled", sa.Boolean(), nullable=True))

    # Set all existing records to enabled=True
    op.execute("UPDATE continuous_evals SET enabled = TRUE WHERE enabled IS NULL")

    # Now make it non-nullable
    op.alter_column("continuous_evals", "enabled", nullable=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("continuous_evals", "enabled")
    # ### end Alembic commands ###
