From 4f7e63ed4a260f6e24f49255e25fc4fe7eab6c42 Mon Sep 17 00:00:00 2001 From: Tuan Vuong Date: Thu, 19 Mar 2026 10:54:24 +0700 Subject: [PATCH] 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 0000000000..fa8724046c --- /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 a2c8329540..88affb3c51 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