"""scheduler job interval overrides

Revision ID: 0015_scheduler_settings
Revises: 0014_demo_account
Create Date: 2026-06-16

Adds scheduler_settings: a per-job run-interval override (minutes), editable from the admin
Scheduler dashboard. Absent row = use the env/config default, so this is purely additive.
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

revision: str = "0015_scheduler_settings"
down_revision: Union[str, None] = "0014_demo_account"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.create_table(
        "scheduler_settings",
        sa.Column("job_id", sa.String(length=40), primary_key=True),
        sa.Column("interval_minutes", sa.Integer(), nullable=False),
    )


def downgrade() -> None:
    op.drop_table("scheduler_settings")
