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"); +