"""Task: Add is_admin to users

Revision ID: 024
Revises: 023
Create Date: 2026-07-05

新增 is_admin 字段到 users 表，用于模板管理等管理员权限校验。
"""

import sqlalchemy as sa

from alembic import op

revision = "024"
down_revision = "023"
branch_labels = None
depends_on = None


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


def downgrade() -> None:
    op.drop_column("users", "is_admin")
