Restore _mark_all_migrations_applied for P3005 baselining path

P3005 fires only during the db-push-to-migrate transition, when the
_prisma_migrations table doesn't exist yet. Since db push already kept
the schema in sync, all shipped migrations are already reflected in the
DB. Mark them all as applied (standard Prisma baselining) instead of
running deploy-with-resolution, which would fail on pre-existing data
issues like duplicate rows preventing unique index creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-12 12:24:46 -07:00
parent 85e28c9f31
commit b4ee36c5c8

View file

@ -449,11 +449,14 @@ class ProxyExtrasDBManager:
)
ProxyExtrasDBManager._create_baseline_migration(schema_path)
logger.info(
"Baseline migration created, running deploy with idempotent resolution "
"to apply remaining migrations..."
"Baseline migration created, marking all existing migrations as applied. "
"This is the standard Prisma baselining approach for databases "
"previously managed by db push."
)
ProxyExtrasDBManager._deploy_with_idempotent_resolution()
logger.info("✅ All migrations applied.")
ProxyExtrasDBManager._mark_all_migrations_applied(
migrations_dir
)
logger.info("✅ All migrations marked as applied.")
return True
else:
raise