Repository navigation
docs(composer): update the Composer pages to Composer 0.41.2: required targetRef, upgrade steps, region fix - #9030
Conversation
Composer 0.41.2 is now latest on npm. Port what changed in Composer's own guides since 0.40.0: postgres() requires targetRef and every deploy and prisma dev run migrates to it, refs with policies take effect, the app lists the Prisma ORM packages and the contract's required capabilities, the region applies to every deploy once set, the upgrade steps for the required targetRef and the new contract hashes, and the skills postinstall hook belongs at a monorepo's workspace root. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…alone Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Give previews named after Git branches a targetRef rule that needs no ref file per branch, and point deploy on push at it. Move the region into its own subsection and stop other pages saying it matters only at creation. Keep the targetRef upgrade inside the contract-hash upgrade for apps on 0.40.0. Leave the workspace hook section of the skills reference to its own pull request. Protect the pinned versions from the version bump job, keep the targetRef rules in the API reference, and link the Prisma ORM instructions the upgrade steps name. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
✅ Gizmo reviewed 88b927d — posted 0 inline comment(s) this pass. Open findings: none Change walkthroughThis pull request updates the Prisma Composer documentation from Composer 0.40.0 to 0.41.2, carrying over by hand the behavior changes described in the prisma/composer guides:
|
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 8 minutes. View limit details
|
🍈 Lychee Link Check Report293 links: ✅ All links are working!Full Statistics Table
|
…ER fix Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Composer 0.41.2 is now
lateston 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 everypostgres({ ... })database to name atargetRef: 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 andprisma8.0.0-rc.39.At a glance
'@contract'means the contract the current commit emits; any other value names a committed ref file inmigrations/app/refs/. Every deploy and everyprisma devrebuild runsprisma 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:
targetRefis 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.pg,@types/pgandtemporal-polyfill. The contract entry inprisma.config.tsgains arequiredCapabilitiesfield.postinstallhook belongs in a monorepo's rootpackage.json, not a workspace package's.What this pull request changes
composer/databases.mdx,composer/api-reference.mdx: thepostgres()section, the database example and "How migrations are applied". The example installs the ORM's packages at 8.0.0-rc.28, sets aproductionref before its first deploy, and passestargetRef.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 requiredtargetRef, 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 itstargetRef. Deploy on push names each preview after its Git branch, which has no ref of its own, sodeploying.mdxmigratesproductionandstagingto 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 --fixjob runs every three hours and rewrites any8.0.0-rc.Nthat is not the newest release. Five pages get itslint-versions-ignore-filemarker, which turns the check off for the whole page until someone removes it:composer/databases.mdxandcomposer/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.mdxandguides/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
prisma devrefuses a local database moved withprisma db updateuntil 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.postgres()withouttargetRef. 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.migration ref policy showandset,db sign --force,--permit-policy-change, and the warningMIGRATION.CONTRACT_SNAPSHOT_PROFILE_NOT_UPDATED. That gap predates this change.Related pull requests
CONTRACT.MARKER_MISMATCHwhere these pages nameCONTRACT.SIGNATURE_MISMATCH, which is what rc.28 prints.How it was checked
targetReftype and refused values, the region error, the install lines' peer dependencies, andprisma@8.0.0-rc.39's dependencies. Their findings are fixed here, except the ones listed above.Agent: herodotus-23
🤖 Generated with Claude Code