docs: make the local Prisma Postgres migrate step work on every run - #8300
ankur-arch wants to merge 3 commits into
Conversation
The Local Postgres page told readers to copy only `DATABASE_URL` from the `prisma dev` output, and its `.env` example showed a `prisma+postgres://` URL that the command no longer prints. Tested against prisma 7.10.0: with just `DATABASE_URL`, the first `prisma migrate dev` run succeeds and every later run fails with `relation "User" already exists`. With `SHADOW_DATABASE_URL` wired to `shadowDatabaseUrl`, repeated runs and follow-up migrations work. Step 1 now copies both URLs, shows the matching config, and step 2 gets a troubleshooting note for the P1017 failure tracked in prisma/orm#29366, with the `_prisma_migrations` workaround from that thread and `db push` as the alternative. Closes #7886 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughThe local development guide now uses direct PostgreSQL URLs for Prisma ORM and Prisma Migrate. It also documents a fresh-instance ChangesLocal Prisma Postgres documentation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The documented migration guidance is appropriately scoped for the reported local setup, with no confirmed issue blocking merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🍈 Lychee Link Check Report7 links: ✅ All links are working!Full Statistics Table
|
The upstream repository was renamed from prisma/prisma to prisma/orm and GitHub returns 404 for the old issue URL, which is what the Lychee check on this pull request reported. Point the link and the issue shorthand at prisma/orm#29366; the page's other links and the migrate steps were verified against prisma 7.10.0 and are unchanged.
|
Review round 1 at d54aa58. One finding, fixed and pushed as fe3ef94 (plus a merge of current Found
Verified, no change
Will re-read the new head cold next. — reviewer |
|
Review clean at fe3ef94. Cold re-read of the head, including my round-1 link fix. The PR changes one page, Checked on this head: branch is level with Risk: low. Docs-only, one page, additive, and every statement on it was verified against the CLI it documents. One thing outside this PR: the page lives in the unversioned (Prisma 8) tree but documents the Prisma ORM 7 workflow end to end. On — reviewer |
Fixes #7886.
The Local Postgres page told readers to copy only
DATABASE_URLfrom theprisma devoutput, and its.envexample showed aprisma+postgres://URL that the command no longer prints.DATABASE_URLandSHADOW_DATABASE_URLinto.envand shows the matchingdatasourceconfig withshadowDatabaseUrl.P1017failure tracked in Command prisma migrate dev gives P1017 against local PGlite orm#29366, with the_prisma_migrationsworkaround from that thread anddb pushas the alternative.Validation
Tested with prisma 7.10.0 (
prisma@prev) against a freshnpx prisma dev --name ...instance:DATABASE_URL: the firstprisma migrate dev --name initsucceeds; the second run fails withrelation "User" already existseven thoughmigrate statusreports the database up to date.SHADOW_DATABASE_URLwired toshadowDatabaseUrl:migrate dev --name init, a no-opmigrate dev, and a follow-upmigrate dev --name add-postall succeed.P1017itself did not reproduce on 7.10.0 in two fresh attempts; the upstream issue is still open with reports through June, so the note stays conditional.check-ai-signs.shclean.🤖 Generated with Claude Code
Summary by CodeRabbit
DATABASE_URLandSHADOW_DATABASE_URL.prisma.config.tsconfiguration example.P1017migration failures, including database setup and an alternativeprisma db pushworkflow.