"""Add revoked_at column to api_keys table

Revision ID: 003_add_revoked_at
Revises: 002_add_tier_daily_count
Create Date: 2026-02-22

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '003_add_revoked_at'
down_revision = '002_add_tier_daily_count'
branch_labels = None
depends_on = None


def upgrade() -> None:
    """Add revoked_at column to api_keys table for tracking key revocation timestamps."""
    op.add_column(
        'api_keys',
        sa.Column('revoked_at', sa.DateTime(), nullable=True)
    )


def downgrade() -> None:
    """Remove revoked_at column from api_keys table."""
    op.drop_column('api_keys', 'revoked_at')