← Back to Pull requests

docs(cli): document the formatter config, and what to do when db migrate fails with MIGRATION.PATH_UNREACHABLE #8853

Closed
unknown closed this pull request without merging on Nov 17, 2026 12:13 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 19:52 UTC
Author

``typescript title="prisma.config.ts"
export default definePrismaConfig({
orm: ormConfig({
contract: "./prisma/contract.prisma",
formatter: { indent: 4, newline: "LF" },
}),
});


The CLI configuration page now documents `formatter`, the setting above that `prisma contract format` and the editor extension read. The `db migrate` page gains a section on `MIGRATION.PATH_UNREACHABLE`, the error you get when no migration on disk leads to the target.

## What the pages now say

**`cli/configuration.mdx`, new section "Schema formatting".**

- `contract format` rewrites every `.prisma` file the `contract` setting matches. It always writes; there is no check-only mode, so the section gives the CI recipe (`contract format`, then `git diff --exit-code`).
- `formatter.indent` is a whole number of 1 or more, or `"tab"`. The default is 2.
- `formatter.newline` is `"LF"` or `"CRLF"`. Without it, the command writes the operating system's line ending and the editor extension writes `LF`, so the two disagree on Windows. The section says to set it when anyone works from Windows.
- An invalid value fails every command that reads the config with `CLI.CONFIG_FIELD_INVALID`.
- The setting needs `@prisma/orm-postgres` or `@prisma/orm-mongo` 8.0.0-rc.24. Earlier releases ignore it without an error (fixed by prisma/orm#30960).

**`cli/db-migrate.mdx`, new section "When no migration reaches the target".** It covers three cases, each with the commands to type:

1. You changed the contract and did not plan a migration.
2. You passed `--to` with an earlier migration.
3. The project has no migrations yet.

It also lists the fields a script finds in the error's `meta` with `--json`.

**`cli/index.mdx`** links the existing mention of `contract format` to the new section.

## A defect in the CLI that the page works around

In case 1, the error prints this suggestion:

text
→ Plan the missing edge: prisma migration plan --from <current hash> --to <target hash> --name <slug>
`

Running it fails with MIGRATION.REF_NOT_FOUND, because --to only finds a contract that a migration or ref already names, and the new contract has neither yet. The command that works leaves out --to. The page tells the reader to do that. I will record the defect in the audit's changes.md as a new item for prisma/orm; when it is fixed, the warning sentence on the page goes away.

What was checked

Every command and output on both sections was run on prisma 8.0.0-rc.34 with @prisma/orm-postgres 8.0.0-rc.24, in a scratch project outside this repository, against PostgreSQL 15:

  • contract format with no formatter, indent: 4, indent: 'tab', indent: 1, newline: 'CRLF'; and the rejected values indent: 0, indent: 1.5, indent: 'tabs', newline: 'CR'.

  • contract format on a glob that matches a file without the // use prisma-8 first line (it formats that file too).

  • All three PATH_UNREACHABLE cases, in text and --json output, plus the suggested command that fails and the command that works.
  • Six cold reader rounds ran with the docs-reader-review skill, three of them on 17 November 2026 after the first review comments. The last round had no marks on schema formatting. Its three prose checks pass on the changed pages.

    Fixes that came through prisma/web#8850

    An earlier version of this pull request also fixed the link check on main (a bare relative link in the generated ORM error reference) and stale version numbers. Both fixes are now on main through prisma/web#8850, so this pull request changes the four CLI pages only.

    Alternatives considered

  • A dedicated cli/contract-format.mdx page. The command has no flags of its own, so everything a reader needs is the config setting, and it sits with the other config settings.

  • Two pull requests. Each section alone is too small to be worth a review.
  • 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
    Documented
    contract format, including which schema files it formats, formatter settings, line endings, editor support, version requirements, and errors for invalid settings.
    Clarified database connection selection when
    --db` is omitted and how formatter settings apply to Prisma ORM 7 schemas.
    Added guidance for migration path errors, their metadata, and options for planning or applying migrations, including projects with no migrations.
    Clarified that a verification failure prevents signing only the affected contract space.
    Updated the transaction timeout reference and refreshed CLI installation examples to version 0.10.0.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 604 lines (+453 / -151) across 7 files Reviewer: wmadden-electric Review duration: 980m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.73) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.73 · 604 lines diff across 7 files
    0.73
    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.383
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.073
    Real PR Conversation Timeline
    1 comments
    "Review active on #8853"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 73.3% (HIGH) · Higher = larger blast radius
    73.3%
    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: 28.9% · Safe to merge
    28.9%
    Repository