"""users.active

Revision ID: 0008_user_active
Revises: 0007_blueprint_overlay_expose_server_cfg
Create Date: 2026-05-10
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op


revision: str = "0008_user_active"
down_revision: Union[str, Sequence[str], None] = "0007_blueprint_overlay_expose_server_cfg"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "users",
        sa.Column(
            "active",
            sa.Boolean(),
            nullable=False,
            server_default=sa.text("1"),
        ),
    )


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