From 9596d27e4565ea032e03abf47f34efce15a9e653 Mon Sep 17 00:00:00 2001 From: RoyVivat Date: Mon, 6 Apr 2026 15:21:15 -0700 Subject: [PATCH] Add total_spend to LiteLLM_TeamMembership in all schema.prisma copies The migration already added the column to the DB, but all three schema.prisma files were missing the field, causing Prisma to throw InvalidPrismaInvocation on every team membership spend write. Co-Authored-By: Claude Sonnet 4.6 --- litellm-proxy-extras/litellm_proxy_extras/schema.prisma | 7 ++++--- litellm/proxy/schema.prisma | 7 ++++--- schema.prisma | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index fce95465b55..12beefd68c6 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -608,9 +608,10 @@ model LiteLLM_UserNotifications { model LiteLLM_TeamMembership { // Use this table to track the Internal User's Spend within a Team + Set Budgets, rpm limits for the user within the team - user_id String - team_id String - spend Float @default(0.0) + user_id String + team_id String + spend Float @default(0.0) + total_spend Float @default(0.0) budget_id String? litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id]) @@id([user_id, team_id]) diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index fce95465b55..12beefd68c6 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -608,9 +608,10 @@ model LiteLLM_UserNotifications { model LiteLLM_TeamMembership { // Use this table to track the Internal User's Spend within a Team + Set Budgets, rpm limits for the user within the team - user_id String - team_id String - spend Float @default(0.0) + user_id String + team_id String + spend Float @default(0.0) + total_spend Float @default(0.0) budget_id String? litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id]) @@id([user_id, team_id]) diff --git a/schema.prisma b/schema.prisma index fce95465b55..12beefd68c6 100644 --- a/schema.prisma +++ b/schema.prisma @@ -608,9 +608,10 @@ model LiteLLM_UserNotifications { model LiteLLM_TeamMembership { // Use this table to track the Internal User's Spend within a Team + Set Budgets, rpm limits for the user within the team - user_id String - team_id String - spend Float @default(0.0) + user_id String + team_id String + spend Float @default(0.0) + total_spend Float @default(0.0) budget_id String? litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id]) @@id([user_id, team_id])