"""make persisted authentication sessions immutable

Revision ID: 20260730_05
Revises: 20260730_04
Create Date: 2026-07-30
"""
from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "20260730_05"
down_revision: str | None = "20260730_04"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    op.drop_column("auth_session", "last_active_at")


def downgrade() -> None:
    op.add_column(
        "auth_session",
        sa.Column(
            "last_active_at",
            sa.DateTime(),
            nullable=False,
            server_default=sa.func.now(),
        ),
    )
