Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

6 changes: 0 additions & 6 deletions litellm-proxy-extras/litellm_proxy_extras/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@ model LiteLLM_VerificationToken {

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (("public"."LiteLLM_VerificationToken"."expires" IS NULL OR "public"."LiteLLM_VerificationToken"."expires" > $1) AND "public"."LiteLLM_VerificationToken"."budget_reset_at" < $2) OFFSET $3
@@index([budget_reset_at, expires])

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (...) ORDER BY "public"."LiteLLM_VerificationToken"."key_alias" ASC
@@index([key_alias])
}

model LiteLLM_JWTKeyMapping {
Expand Down Expand Up @@ -556,9 +553,6 @@ model LiteLLM_SpendLogs {
@@index([startTime, request_id])
@@index([end_user])
@@index([session_id])

// SELECT ... FROM "LiteLLM_SpendLogs" WHERE ("startTime" >= $1 AND "startTime" <= $2 AND "user" = $3) GROUP BY ...
@@index([user, startTime])
}

// View spend, model, api_key per request
Comment on lines 553 to 558
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing revert migration to drop indexes

This PR deletes the migration file 20260309115809_add_missing_indexes/migration.sql and removes the index definitions from the schema, but does not add a new migration to DROP those indexes from databases where the original migration was already applied.

For any deployment that ran the original migration, Prisma's _prisma_migrations table will still record 20260309115809_add_missing_indexes as applied, but the file is now gone. This creates an irrecoverable migration state drift: Prisma will detect that the applied migration history no longer matches the migration files on disk and will refuse to run prisma migrate deploy / prisma migrate status correctly.

A proper revert should include a new migration file, e.g. 20260312_revert_missing_indexes/migration.sql, containing:

-- SkipTransactionBlock

-- Drop index added by 20260309115809_add_missing_indexes
DROP INDEX CONCURRENTLY IF EXISTS "LiteLLM_VerificationToken_key_alias_idx";

-- Drop index added by 20260309115809_add_missing_indexes
DROP INDEX CONCURRENTLY IF EXISTS "LiteLLM_SpendLogs_user_startTime_idx";

Without this, any existing deployment is left in an inconsistent state. The same concern applies to litellm/proxy/schema.prisma and the root schema.prisma.

Expand Down
6 changes: 0 additions & 6 deletions litellm/proxy/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@ model LiteLLM_VerificationToken {

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (("public"."LiteLLM_VerificationToken"."expires" IS NULL OR "public"."LiteLLM_VerificationToken"."expires" > $1) AND "public"."LiteLLM_VerificationToken"."budget_reset_at" < $2) OFFSET $3
@@index([budget_reset_at, expires])

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (...) ORDER BY "public"."LiteLLM_VerificationToken"."key_alias" ASC
@@index([key_alias])
}

model LiteLLM_JWTKeyMapping {
Expand Down Expand Up @@ -565,9 +562,6 @@ model LiteLLM_SpendLogs {
@@index([startTime, request_id])
@@index([end_user])
@@index([session_id])

// SELECT ... FROM "LiteLLM_SpendLogs" WHERE ("startTime" >= $1 AND "startTime" <= $2 AND "user" = $3) GROUP BY ...
@@index([user, startTime])
}

// View spend, model, api_key per request
Expand Down
6 changes: 0 additions & 6 deletions schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@ model LiteLLM_VerificationToken {

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (("public"."LiteLLM_VerificationToken"."expires" IS NULL OR "public"."LiteLLM_VerificationToken"."expires" > $1) AND "public"."LiteLLM_VerificationToken"."budget_reset_at" < $2) OFFSET $3
@@index([budget_reset_at, expires])

// SELECT ... FROM "public"."LiteLLM_VerificationToken" WHERE (...) ORDER BY "public"."LiteLLM_VerificationToken"."key_alias" ASC
@@index([key_alias])
}

model LiteLLM_JWTKeyMapping {
Expand Down Expand Up @@ -556,9 +553,6 @@ model LiteLLM_SpendLogs {
@@index([startTime, request_id])
@@index([end_user])
@@index([session_id])

// SELECT ... FROM "LiteLLM_SpendLogs" WHERE ("startTime" >= $1 AND "startTime" <= $2 AND "user" = $3) GROUP BY ...
@@index([user, startTime])
}

// View spend, model, api_key per request
Expand Down
Loading