From 4f7e63ed4a260f6e24f49255e25fc4fe7eab6c42 Mon Sep 17 00:00:00 2001 From: Tuan Vuong Date: Thu, 19 Mar 2026 10:54:24 +0700 Subject: [PATCH 1/2] fix(schema): restore MCP server fields dropped by schema_sync migration Re-adds missing fields to LiteLLM_MCPServerTable that were accidentally dropped by 20260311180521_schema_sync, and syncs the extras schema.prisma to match the main schema. Co-Authored-By: Claude Sonnet 4.6 --- .../migration.sql | 13 +++++++++++++ .../litellm_proxy_extras/schema.prisma | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 litellm-proxy-extras/litellm_proxy_extras/migrations/20260319000000_restore_mcp_approval_fields/migration.sql diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260319000000_restore_mcp_approval_fields/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260319000000_restore_mcp_approval_fields/migration.sql new file mode 100644 index 00000000000..fa8724046c2 --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260319000000_restore_mcp_approval_fields/migration.sql @@ -0,0 +1,13 @@ +-- Restore fields dropped by 20260311180521_schema_sync on LiteLLM_MCPServerTable +-- AlterTable +ALTER TABLE "LiteLLM_MCPServerTable" + ADD COLUMN IF NOT EXISTS "source_url" TEXT, + ADD COLUMN IF NOT EXISTS "approval_status" TEXT DEFAULT 'active', + ADD COLUMN IF NOT EXISTS "submitted_by" TEXT, + ADD COLUMN IF NOT EXISTS "submitted_at" TIMESTAMP(3), + ADD COLUMN IF NOT EXISTS "reviewed_at" TIMESTAMP(3), + ADD COLUMN IF NOT EXISTS "review_notes" TEXT; + +-- CreateIndex +CREATE INDEX IF NOT EXISTS "LiteLLM_MCPServerTable_approval_status_idx" + ON "LiteLLM_MCPServerTable"("approval_status"); diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index a2c83295403..88affb3c519 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -320,11 +320,14 @@ model LiteLLM_MCPServerTable { is_byok Boolean @default(false) byok_description String[] @default([]) byok_api_key_help_url String? + source_url String? approval_status String @default("approved") submitted_by String? submitted_at DateTime? reviewed_at DateTime? review_notes String? + + @@index([approval_status]) } // Per-user BYOK credentials for MCP servers From 93e3c81772dd204ae3314a199a85e5bb325289c1 Mon Sep 17 00:00:00 2001 From: Tuan Vuong Date: Thu, 19 Mar 2026 11:06:25 +0700 Subject: [PATCH 2/2] fix(schema): align approval_status default in proxy-extras schema Change default from "approved" to "active" and make field nullable (String?) to match litellm/proxy/schema.prisma and the migration SQL. Co-Authored-By: Claude Sonnet 4.6 --- litellm-proxy-extras/litellm_proxy_extras/schema.prisma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index 88affb3c519..d8d6015ce87 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -321,7 +321,7 @@ model LiteLLM_MCPServerTable { byok_description String[] @default([]) byok_api_key_help_url String? source_url String? - approval_status String @default("approved") + approval_status String? @default("active") submitted_by String? submitted_at DateTime? reviewed_at DateTime?