31 lines
886 B
Python
31 lines
886 B
Python
|
|
"""admin account suspension
|
||
|
|
|
||
|
|
Revision ID: 0023_user_suspension
|
||
|
|
Revises: 0022_password_auth
|
||
|
|
Create Date: 2026-06-19
|
||
|
|
|
||
|
|
Adds users.is_suspended — an admin-controlled access block, distinct from is_active (the
|
||
|
|
approval lifecycle). A suspended account can't sign in (password or Google) and any live
|
||
|
|
session is rejected; the user is told why and given the operator's contact.
|
||
|
|
"""
|
||
|
|
from typing import Sequence, Union
|
||
|
|
|
||
|
|
import sqlalchemy as sa
|
||
|
|
from alembic import op
|
||
|
|
|
||
|
|
revision: str = "0023_user_suspension"
|
||
|
|
down_revision: Union[str, None] = "0022_password_auth"
|
||
|
|
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("is_suspended", sa.Boolean(), nullable=False, server_default="false"),
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
op.drop_column("users", "is_suspended")
|