Files
webmail-client/backend/migrations/versions/0019_user_blocked.py
T

30 lines
758 B
Python
Raw Normal View History

"""administrator can block a user
``users.blocked_at`` is set while an administrator has blocked the account: it
cannot sign in and its sessions stop working. NULL means not blocked. A
timestamp rather than a flag so the admin panel can say since when.
Revision ID: 0019
Revises: 0018
Create Date: 2026-09-30
"""
from __future__ import annotations
from collections.abc import Sequence
from alembic import op
revision: str = "0019"
down_revision: str | None = "0018"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
op.execute("ALTER TABLE users ADD COLUMN blocked_at timestamptz")
def downgrade() -> None:
op.execute("ALTER TABLE users DROP COLUMN IF EXISTS blocked_at")