The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(litellm-proxy-extras/utils.py): run resolve_all_migrations after running prisma migrate deploy
Krrish Dholakia43826e3cdd8e
diff --git a/litellm-proxy-extras/litellm_proxy_extras/utils.py b/litellm-proxy-extras/litellm_proxy_extras/utils.pyindex ece2b496bf6..73065b050b7 100644--- a/litellm-proxy-extras/litellm_proxy_extras/utils.py+++ b/litellm-proxy-extras/litellm_proxy_extras/utils.py@@ -131,7 +131,9 @@ class ProxyExtrasDBManager:)@staticmethod- def _resolve_all_migrations(migrations_dir: str, schema_path: str):+ def _resolve_all_migrations(+ migrations_dir: str, schema_path: str, mark_all_applied: bool = True+ ):"""1. Compare the current database state to schema.prisma and generate a migration for the diff.2. Run prisma migrate deploy to apply any pending migrations.@@ -210,6 +212,8 @@ class ProxyExtrasDBManager:logger.warning("Migration diff application timed out.")# 3. Mark all migrations as applied+ if not mark_all_applied:+ returnmigration_names = ProxyExtrasDBManager._get_migration_names(migrations_dir)logger.info(f"Resolving {len(migration_names)} migrations")for migration_name in migration_names:@@ -263,6 +267,13 @@ class ProxyExtrasDBManager:logger.info(f"prisma migrate deploy stdout: {result.stdout}")logger.info("prisma migrate deploy completed")++ # Run sanity check to ensure DB matches schema+ logger.info("Running post-migration sanity check...")+ ProxyExtrasDBManager._resolve_all_migrations(+ migrations_dir, schema_path, mark_all_applied=False+ )+ logger.info("✅ Post-migration sanity check completed")return Trueexcept subprocess.CalledProcessError as e:logger.info(f"prisma db error: {e.stderr}, e: {e.stdout}")