Skip to content

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]

fix(migration): run schema sanity check after P3009/P3018 idempotent migration recovery

Ishaan Jaffer7c47bbd226fa
diff --git a/litellm-proxy-extras/litellm_proxy_extras/utils.py b/litellm-proxy-extras/litellm_proxy_extras/utils.py
index 2991f3f6058..87d74513c00 100644
--- a/litellm-proxy-extras/litellm_proxy_extras/utils.py
+++ b/litellm-proxy-extras/litellm_proxy_extras/utils.py
@@ -441,6 +441,10 @@ class ProxyExtrasDBManager:
logger.warning(
f"Failed to resolve migration {failed_migration}: {resolve_err}"
)
+ # Apply any schema drift not covered by the marked-as-applied migration
+ ProxyExtrasDBManager._resolve_all_migrations(
+ migrations_dir, schema_path, mark_all_applied=False
+ )
else:
logger.info(
f"Found failed migration: {failed_migration}, marking as rolled back"
@@ -564,6 +568,10 @@ class ProxyExtrasDBManager:
logger.warning(
f"Failed to resolve migration {migration_name}: {resolve_err}"
)
+ # Apply any schema drift not covered by the marked-as-applied migration
+ ProxyExtrasDBManager._resolve_all_migrations(
+ migrations_dir, schema_path, mark_all_applied=False
+ )
else:
# Unknown P3018 error - log and re-raise for safety
logger.warning(