← Back to Pull requests

docs(composer): update the Composer pages to Composer 0.41.2: required targetRef, upgrade steps, region fix #9030

Closed
unknown closed this pull request without merging on Dec 03, 2026 12:32 UTC
View on GitHub
unknown unknown commented on Dec 03, 2026 11:32 UTC
Author

Composer 0.41.2 is now latest on npm, but the Composer pages on docs.prisma.io still describe Composer 0.40.0. An app that follows them today fails its type check, because Composer 0.41 requires every postgres({ ... }) database to name a targetRef: the migration ref the database is migrated to on each deploy. This pull request brings the Composer pages, and the pages elsewhere that describe the same things, up to Composer 0.41.2, Prisma ORM 8.0.0-rc.28 and prisma 8.0.0-rc.39.

At a glance

const db = provision(
  postgres({
    name: 'database',
    contract: catalogData,
    config: './prisma.config.ts',
    targetRef: resolve([environment.name], ([name]) => (name === 'dev' ? '@contract' : name)),
  }),
);

'@contract' means the contract the current commit emits; any other value names a committed ref file in migrations/app/refs/. Every deploy and every prisma dev rebuild runs prisma db migrate --to <targetRef> on the database.

What changed in Composer since 0.40.0

These pages are a rewritten copy of the guides in the prisma/composer repository, so each change there has to be carried over by hand. These changes affect the pages:

  • targetRef is required, and every deploy runs the ORM's migrate to it. Before, Composer judged for itself whether a database was up to date and refused any ref that declared policies. Now the ORM checks the policies, and a deploy stops with the ORM's own error when they differ from the database's.

  • The app lists the ORM's packages itself, all at the exact version Composer names, plus pg, @types/pg and temporal-polyfill. The contract entry in prisma.config.ts gains a requiredCapabilities field.

  • Prisma ORM 8.0.0-rc.26 changed how contract hashes are computed. An app upgrading from Composer 0.40.0 moves its contract, migrations, refs and each database's signature to the new hashes once, by hand.

  • The region. Only an app's first deploy needs one. But when one is set, every deploy creates the app's services and databases in it, so changing it later replaces a database with a new, empty one. The pages said the region was ignored once the project existed.

  • The skills postinstall hook belongs in a monorepo's root package.json, not a workspace package's.
  • What this pull request changes

  • composer/databases.mdx, composer/api-reference.mdx: the postgres() section, the database example and "How migrations are applied". The example installs the ORM's packages at 8.0.0-rc.28, sets a production ref before its first deploy, and passes targetRef.

  • composer/deploying.mdx: a Region subsection, and new sections on a ref for each new environment, on a deploy that refuses a ref's policies, and on three upgrades: to a required targetRef, to the new contract hashes, and from Composer 0.41.0 or 0.41.1. Review the upgrade steps closely. Readers run them against production databases, and a step done out of order can make a later deploy apply every migration again. They match Composer's own guide step for step.

  • compute/deploy-on-push.mdx: the database migrates to its targetRef. Deploy on push names each preview after its Git branch, which has no ref of its own, so deploying.mdx migrates production and staging to their refs and every other environment to '@contract'. A preview then tests its branch's schema, but not the ref or the policies production will migrate to; the page says so and gives the alternative.

  • cli/deploy.mdx, (index)/prisma-compute/deploy.mdx, guides/compute/astro-marketing-site.mdx: the region.

  • composer/getting-started.mdx: the skills hook in a monorepo.

  • guides/compute/deploy-existing-app.mdx: one sentence saying the Console installs Composer 0.40.0 while the Composer pages describe 0.41.2, and which section moves an app up.

  • composer/local-development.mdx, composer/service-input.mdx, composer/apps-and-modules.mdx: the migrate wording, the upgrade link and versions.

  • guides/upgrade-prisma-orm/index.mdx: only the marker described next.
  • Pages the version lint skips

    Web's lint:versions --fix job runs every three hours and rewrites any 8.0.0-rc.N that is not the newest release. Five pages get its lint-versions-ignore-file marker, which turns the check off for the whole page until someone removes it:

  • composer/databases.mdx and composer/deploying.mdx. Their ORM versions are the ones Composer 0.41.2 pins, not the ORM's newest release; the job would rewrite them and break the install line and the upgrade steps. They move the next time these pages are brought up to date with Composer.

  • composer/service-input.mdx, whose upgrade steps pin the versions Composer 0.40.0 was built with.

  • guides/compute/deploy-existing-app.mdx and guides/upgrade-prisma-orm/index.mdx. They state the versions the Prisma Console's Compute setup installs, still Composer 0.40.0 and ORM 8.0.0-rc.25. They move when the Console moves.
  • Left out

  • A Prisma ORM bug. Composer's guide warns that prisma dev refuses a local database moved with prisma db update until a migration ends at its contract. Web's docs rules say to fix or file a tool's defect, not to document it. It is filed as Linear issue TML-3999. Readers who plan a migration for each schema change, as these pages say, never reach it.

  • The Vike and Remix guides also break on 0.41.2, because they install Composer without a version and call postgres() without targetRef. Each needs a tested rewrite, which comes in a follow-up pull request. The full-stack tutorial scaffolds with create-prisma, which still pins Composer 0.40.0, so it is consistent for now.

  • The CLI reference lacks some commands these pages use: migration ref policy show and set, db sign --force, --permit-policy-change, and the warning MIGRATION.CONTRACT_SNAPSHOT_PROFILE_NOT_UPDATED. That gap predates this change.
  • Related pull requests

  • prisma/web#9028 brings the ORM pages to 8.0.0-rc.28 and renames the database's "marker" to its "signature". The two change no file in common and can merge in either order. Until #9028 merges, ORM pages name CONTRACT.MARKER_MISMATCH where these pages name CONTRACT.SIGNATURE_MISMATCH, which is what rc.28 prints.

  • prisma/web#9029 adds the workspace rules to the CLI's skills page. The getting-started paragraph here agrees with it and links to that page.
  • How it was checked

  • Two reviewers, one for the design and one for the text, compared every upgrade step with Composer's guide and, where they could, with Composer's code and npm: the targetRef type and refused values, the region error, the install lines' peer dependencies, and prisma@8.0.0-rc.39's dependencies. Their findings are fixed here, except the ones listed above.

  • Web's version check passes on the changed pages. Anchors were checked by hand; CI runs the site build and the link lint.
  • Agent: herodotus-23

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: wmadden-electric Review duration: 59m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9030"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%
    Repository