From fdd8a706baff29c2c53a2a5c2f760d969b4d1790 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 12 Mar 2026 11:47:14 -0700 Subject: [PATCH] Address Greptile review feedback on migration startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix bare `raise` → `raise e` in unreachable else branch of _resolve_failed_migration for correctness and clarity - Remove _mark_all_migrations_applied from P3005 path — it was marking ALL migrations (including new ones) as applied, causing new migration SQL to never run. Now baseline creation is followed directly by _deploy_with_idempotent_resolution which actually runs pending migrations. Co-Authored-By: Claude Opus 4.6 --- litellm-proxy-extras/litellm_proxy_extras/utils.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/litellm-proxy-extras/litellm_proxy_extras/utils.py b/litellm-proxy-extras/litellm_proxy_extras/utils.py index 3446aa36600..2930c128c8d 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/utils.py +++ b/litellm-proxy-extras/litellm_proxy_extras/utils.py @@ -339,7 +339,7 @@ class ProxyExtrasDBManager: ) from e migration_name = migration_match.group(1) else: - raise # Not a P3009/P3018 — let outer handler deal with it + raise e # Not a P3009/P3018 — let outer handler deal with it # Check if idempotent — if not, fail fast if not ProxyExtrasDBManager._is_idempotent_error(stderr): @@ -450,14 +450,8 @@ class ProxyExtrasDBManager: ) ProxyExtrasDBManager._create_baseline_migration(schema_path) logger.info( - "Baseline migration created, marking all existing migrations as applied" - ) - ProxyExtrasDBManager._mark_all_migrations_applied( - migrations_dir - ) - # Now run deploy with resolution for any pending migrations - logger.info( - "Running prisma migrate deploy for any pending migrations..." + "Baseline migration created, running deploy with idempotent resolution " + "to apply remaining migrations..." ) ProxyExtrasDBManager._deploy_with_idempotent_resolution() logger.info("✅ All migrations applied.")