"""Add expires_at column to user_api_keys

Revision ID: c52984bde339
Revises: e7a936dc8024
Create Date: 2025-09-24 19:30:14.580177

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "c52984bde339"
down_revision = "e7a936dc8024"
branch_labels = None
depends_on = None


def upgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.create_index(
    op.f("ix_graphs_parent_graph_id"), "graphs", ["parent_graph_id"], unique=False
  )
  op.add_column("user_api_keys", sa.Column("expires_at", sa.DateTime(), nullable=True))
  # ### end Alembic commands ###


def downgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.drop_column("user_api_keys", "expires_at")
  op.drop_index(op.f("ix_graphs_parent_graph_id"), table_name="graphs")
  # ### end Alembic commands ###
