"""add triggered_by to eval_runs

Revision ID: b7d4e6f81c22
Revises: a64b2f8c9d10
Create Date: 2026-07-27
"""
from typing import Sequence, Union

import sqlalchemy as sa
import sqlmodel  # noqa: F401
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "b7d4e6f81c22"
down_revision: Union[str, Sequence[str], None] = "a64b2f8c9d10"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    with op.batch_alter_table("eval_runs") as batch_op:
        batch_op.add_column(
            sa.Column("triggered_by", sa.String(), nullable=False, server_default="manual")
        )


def downgrade() -> None:
    with op.batch_alter_table("eval_runs") as batch_op:
        batch_op.drop_column("triggered_by")
