"""add analysis default flag to model configs

Revision ID: a3f9c2e71b48
Revises: e6c3d1a2f809
Create Date: 2026-08-02
"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

revision: str = "a3f9c2e71b48"
down_revision: Union[str, Sequence[str], None] = "e6c3d1a2f809"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    with op.batch_alter_table("model_configs", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column("is_analysis_default", sa.Boolean(), nullable=False, server_default=sa.false())
        )


def downgrade() -> None:
    with op.batch_alter_table("model_configs", schema=None) as batch_op:
        batch_op.drop_column("is_analysis_default")
