fix(deploy): tolerate P3005 (prod schema not baselined) in build#29
Merged
Conversation
Vercel deploys started failing after #25 because production was populated via 'prisma db push' (or equivalent) with no migration history. 'prisma migrate deploy' refuses with P3005 in that state because it can't tell which migrations are already applied — and running them blindly would re-create existing tables. Until the prod database is baselined, treat P3005 as 'skip and continue' so deploys still ship. Pending migrations don't apply (they'll need a one-time manual baseline + redeploy), but the rest of the build proceeds normally. The warning prints the exact baseline commands so an operator can do this safely when ready: pnpm exec prisma migrate resolve --applied <migration_name> … for each existing migration, then redeploy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Vercel deploys on
mainare failing with:This means production was populated via
prisma db pushor equivalent — the schema exists but_prisma_migrationsis empty, somigrate deployrefuses to run pending migrations because it can't tell what's already applied.Effect
Every push to
mainsince #25 has been blocked. The latest deploy stuck onmainis the pre-#28 code, which still has the autocompleteLIMIT == COUNTbug. PRs #19, #22, #23, #24, #26, #27, #28 are all merged onmainbut not live — Vercel hasn't successfully deployed any commit since #25 went in.Fix
scripts/maybe-migrate.mjsnow catches P3005 specifically, logs an actionable warning with the baseline commands, and exits 0. Other errors still fail the build.Trade-off: pending migrations (the new pg_trgm + listing-indexes ones) don't auto-apply. They land on the database only after a one-time baseline operation. Until then, the new code falls back to its safe paths:
getLocationSuggestions→try/catchreturns[]if pg_trgm missinggetFullTextMatchingIds→ same graceful fallbackAfter this lands
🤖 Generated with Claude Code