← Back to Pull requests

docs(guides): the MongoDB upgrade runs Prisma 8 beside Prisma 6, and the upgrade and switch guides match rc.24 #8883

Closed
unknown closed this pull request without merging on Nov 20, 2026 14:04 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 11:19 UTC
Author

The MongoDB upgrade guide began with this command:

npx prisma@latest orm init --target mongodb --authoring psl

It installs Prisma 8 over the Prisma 6 CLI. The same guide then asks the reader to keep the Prisma 6 app deployable, but from that point the Prisma 6 command fails:

$ npx prisma db push
CLI.V7_COMMAND

The guide is now ordered so that Prisma 8 runs beside Prisma 6 from the first step. orm init without flags stops with CLI.INIT_PRISMA6_SCHEMA_FOUND and prints the side-by-side setup; the guide follows it: a prisma6 alias for the Prisma 6 CLI, prisma6Schema('prisma/schema.prisma') so Prisma 8 reads the existing schema, then contract emit and db sign. Only after the client calls are ported does the schema move to a Prisma 8 contract file.

This is one of 25 findings on the upgrade and switch guides from a full audit of the Prisma ORM 8 docs against prisma 8.0.0-rc.34 and the ORM packages at 8.0.0-rc.24. This pull request fixes all of them.

What changed

  • MongoDB upgrade guide, types. The type table said the Prisma 6 Int "still works". In Prisma 8, Int means a 32-bit integer, and its validator refuses the 64-bit values Prisma 6 stored. The guide now maps Int to Int64Number.

  • MongoDB upgrade guide, schema refusals. A new table lists the nine PSL.PRISMA6_MONGO_ errors a valid Prisma 6 schema can hit when Prisma 8 reads it, what to change for each, and what that change does to the running Prisma 6 app.

  • MongoDB validators. Two guides said adding a validator is destructive and that existing documents are not checked. Since rc.24 every apply checks the documents first and stops with MIGRATION.PRECHECK_FAILED, printing the query that finds the documents that do not fit. Both guides now describe that, and the checkDocuments: false override.

  • Removing Prisma 6. npm uninstall prisma6 @prisma/client also removes the prisma command, because the alias declares a command of the same name. The step now runs npm install afterwards and checks npx prisma --version.

  • PostgreSQL, route by route. The index page said this guide infers a new contract from the database; it reads schema.prisma through prisma7Schema(...). pg_search is added to the extensions that need a pack (@prisma/orm-extension-paradedb). migration status after db sign prints No migrations found, not Up to date. The one-command orm init path writes to src/prisma.

  • Switch guides. from-sql-orms, from-drizzle and from-mongoose were re-run on real TypeORM, Drizzle and Mongoose apps. Printed output is from the current versions, db.ts imports ./contract.d.js, and an optional field can be left out of create.

  • Multiple databases. A missing config fails with CLI.CONFIG_SECTION_INVALID, not CONFIG.FILE_NOT_FOUND.
  • guides/upgrade-prisma-orm/postgresql.mdx keeps its pinned versions, which are the ones the Console's Compute setup installs; only pg_search is added there. One page outside the guides changes so it does not contradict them: orm/coming-from-prisma-orm-7.mdx.

    The MongoDB guide no longer recommends the prisma-mongodb-upgrade agent skill, because the skill in prisma/skills still teaches the old first command. Updating the skill is separate work.

    How it was checked

    An implementer verified each finding before changing a page. A separate reviewer then followed the MongoDB guide from its first step to its last on a Prisma 6.19 app and a MongoDB 8.0 replica set, doing only what the page says, in two rounds. The Prisma 6 app kept reading and writing throughout. All of the reviewer's findings are fixed. pnpm lint:links and pnpm lint:versions pass.

    Agent: gagarin-12
    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Documentation
    Expanded Prisma ORM migration guides with staged upgrade paths for MongoDB and PostgreSQL, including schema compatibility, incremental client migration, database verification, and cutover steps.
    Updated setup and configuration guidance for orm init, generated contract imports, TypeScript module settings, and Prisma dependencies.
    Clarified MongoDB requirements and behavior, including transaction prerequisites, optional fields, query constraints, and prechecks before applying validators.
    Updated PostgreSQL extension guidance to include pg_search and refined examples for signing, migration status, and query output.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 582 lines (+436 / -146) across 7 files Reviewer: wmadden-electric Review duration: 165m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 582 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.381
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8883"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.9% (MEDIUM) · Higher = larger blast radius
    49.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%
    Repository