"""Add blocked_tokens table

Revision ID: 1d0aaa07743c
Revises: 5f6cb30db996
Create Date: 2025-03-19 15:23:20.233843

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "1d0aaa07743c"
down_revision: Union[str, None] = "5f6cb30db996"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.create_table(
        "blocked_tokens",
        sa.Column("token", sa.String(), nullable=False),
        sa.Column("expires_at", sa.DateTime(), nullable=False),
        sa.Column("excluded_at", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("token"),
    )


def downgrade() -> None:
    op.drop_table("blocked_tokens")
