"""add users.last_login_at — when the account last signed in (E22 S1) Revision ID: 0085_users_last_login_at Revises: 0084_dl_job_error_detail Create Date: 2026-09-16 Stamped by the one sign-in path (`routes/auth._establish_session`), which the Google callback and password login share. No backfill is possible: the signal exists only at sign-in, so existing rows read NULL until each account signs in again, and the admin UI says so rather than inventing a date. """ import sqlalchemy as sa from alembic import op revision: str = "0085_users_last_login_at" down_revision: str | None = "0084_dl_job_error_detail" branch_labels: str | None = None depends_on: str | None = None def upgrade() -> None: op.add_column("users", sa.Column("last_login_at", sa.DateTime(timezone=True), nullable=True)) def downgrade() -> None: op.drop_column("users", "last_login_at")