From 66b6e8d06af0a5cf19b89fb2862f501729b3baa3 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 11 Jul 2026 19:44:37 -0700 Subject: [PATCH] fix(claude-code): add missing Prisma migration for skill marketplaces schema.prisma had the LiteLLM_SkillMarketplaceTable/marketplace_id/ allowed_skills additions but no committed migration captured them, failing the schema_migration_check CI job. Also fix ci_cd/run_migration.py: its temp migrations directory was a fixed path at /migrations, colliding with the real tracked migrations/ directory (Dockerfile, run.py) - running the script deleted it via the cleanup step. Use a real tempdir instead. --- ci_cd/run_migration.py | 8 +++-- .../migration.sql | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 litellm-proxy-extras/litellm_proxy_extras/migrations/20260711194200_add_claude_code_skill_marketplaces/migration.sql diff --git a/ci_cd/run_migration.py b/ci_cd/run_migration.py index feec4046ee1..00307eeae37 100644 --- a/ci_cd/run_migration.py +++ b/ci_cd/run_migration.py @@ -4,6 +4,7 @@ import re import shutil import subprocess import sys +import tempfile from datetime import datetime from pathlib import Path @@ -235,8 +236,11 @@ def create_migration( with testing.postgresql.Postgresql() as postgresql: db_url = postgresql.url() - # Create temporary migrations directory next to schema.prisma - temp_migrations_dir = schema_path.parent / "migrations" + # A temp dir outside the repo, never a fixed path under root_dir - + # `root_dir / "migrations"` collides with the real, tracked + # top-level migrations/ directory (Dockerfile, run.py), and the + # rmtree in the `finally` block below would permanently delete it. + temp_migrations_dir = Path(tempfile.mkdtemp(prefix="litellm_migrations_")) / "migrations" try: # Copy existing migrations to temp directory diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260711194200_add_claude_code_skill_marketplaces/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260711194200_add_claude_code_skill_marketplaces/migration.sql new file mode 100644 index 00000000000..e8e8ba0bd7f --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260711194200_add_claude_code_skill_marketplaces/migration.sql @@ -0,0 +1,31 @@ +-- AlterTable +ALTER TABLE "LiteLLM_ClaudeCodePluginTable" ADD COLUMN "marketplace_id" TEXT; + +-- AlterTable +ALTER TABLE "LiteLLM_ObjectPermissionTable" ADD COLUMN "allowed_skills" TEXT[] DEFAULT ARRAY[]::TEXT[]; + +-- CreateTable +CREATE TABLE "LiteLLM_SkillMarketplaceTable" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "display_name" TEXT, + "source_type" TEXT NOT NULL, + "source_ref" TEXT, + "branch" TEXT DEFAULT 'main', + "owner_name" TEXT, + "owner_email" TEXT, + "enabled" BOOLEAN NOT NULL DEFAULT true, + "sync_status" TEXT NOT NULL DEFAULT 'pending', + "sync_error" TEXT, + "skipped_count" INTEGER NOT NULL DEFAULT 0, + "last_synced_at" TIMESTAMP(3), + "created_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, + "created_by" TEXT, + + CONSTRAINT "LiteLLM_SkillMarketplaceTable_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "LiteLLM_SkillMarketplaceTable_name_key" ON "LiteLLM_SkillMarketplaceTable"("name"); +