"""ml_settings: embedder_model_name (#1190 operator model swap)

The embedder MODEL VERSION was already a setting (and stamps image_record.
siglip_model_version); the HF model NAME was env-only, so an operator couldn't
actually point the pipeline at a different embedder. Storing the name as a
setting makes the model an operator choice: set name + version → re-embed (the
GPU agent) → retrain heads. Default = the current SigLIP so400m.

Revision ID: 0065
Revises: 0064
Create Date: 2026-06-30
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

revision: str = "0065"
down_revision: Union[str, None] = "0064"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "ml_settings",
        sa.Column(
            "embedder_model_name", sa.String(length=128), nullable=False,
            server_default="google/siglip-so400m-patch14-384",
        ),
    )


def downgrade() -> None:
    op.drop_column("ml_settings", "embedder_model_name")
