"""add indexes on graph_backups expires_at and user_repositories repo_name

Revision ID: c7cf00620afb
Revises: 7deba16dcb54
Create Date: 2026-02-12 17:22:42.901601

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "c7cf00620afb"
down_revision = "7deba16dcb54"
branch_labels = None
depends_on = None


def upgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.create_index(
    op.f("ix_graph_backups_expires_at"), "graph_backups", ["expires_at"], unique=False
  )
  op.create_index(
    "idx_user_shared_repo_name_active",
    "user_repository",
    ["repository_name", "is_active"],
    unique=False,
  )
  # ### end Alembic commands ###


def downgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.drop_index("idx_user_shared_repo_name_active", table_name="user_repository")
  op.drop_index(op.f("ix_graph_backups_expires_at"), table_name="graph_backups")
  # ### end Alembic commands ###
