v8.0.0-rc.27
This release fixes what upgrading two real projects from 8.0.0-rc.25 to 8.0.0-rc.26 found. A database that a deploy created after the upgrade and migrated to a ref was signed for the wrong capabilities, so prisma db verify refused it. pnpm installed several copies of @prisma/orm-toolchain in a monorepo, so the prisma command refused to run. And the rc.25 to rc.26 upgrade scripts crashed on TypeScript 7 and stopped on one hand-written fixture anywhere in a repository. Upgrade from 8.0.0-rc.25 to this release in one go: follow the rc.25 to rc.26 guide with this release installed, then the rc.26 to rc.27 guide.
The upgrade guides for this release: the app guide and the extension guide. The rc.25 to rc.26 guides are corrected in this release: the app guide and the extension guide.
The ORM commands of this release need the prisma version whose @prisma/orm-toolchain dependency is 8.0.0-rc.27, which is published shortly after this release. prisma 8.0.0-rc.37 runs the toolchain of 8.0.0-rc.26.
Breaking changes
- A condition from
fnscarries the contract's boolean codec.BooleanCodecTypeand the ORM client'sFunctionConditionnow take the contract's codec types, so a use without type arguments no longer compiles. On MySQL, MariaDB and SQLite, a condition such asfns.eq(...)is typed with the target's boolean codec (mysql/boolean@1orsqlite/boolean@1) instead ofpg/bool@1, and a condition selected as a column reads astrueorfalse(ornull), where it read as'1'/'0'on MySQL and MariaDB and1/0on SQLite. A boolean column is accepted wherever a condition is.createFunctionsandcreateAggregateFunctionsare no longer published; takefnsfrom a query callback. Seeboolean-codec-type-takes-codec-types,function-condition-takes-codec-types,condition-codec-on-mysql-and-sqlite,projected-condition-reads-as-booleanandfunctions-builders-no-longer-publishedin the app guide and the extension guide. (#31296)
Fixes
prisma contract emitgives the snapshot of the emitted contract the emitted capabilities. In 8.0.0-rc.26, the migration snapshot under the emitted contract's storage hash kept the capabilities it was planned with.prisma db migrate --to <ref>, which every Composer deploy runs, signed a new database with that snapshot, andprisma db verifythen failed withCONTRACT.SIGNATURE_MISMATCH: "The database is signed for other capabilities".contract emitnow updates that snapshot'srequiredCapabilitiesandprofileHash, and itscontract.d.ts, and reports it. Commit the snapshot it updates, and sign each database created on 8.0.0-rc.26 withprisma db sign --no-advance-ref. The Vite plugin does not update it. Seeapp-snapshot-gets-emitted-profilein the app guide. (#31333)- pnpm installs one copy of
@prisma/orm-toolchain. The toolchain no longer hasviteas an optional peer, and depends ontypanion, whichclipanionneeds. Each had resolved differently in each package of a pnpm workspace, giving one copy of the toolchain per resolution, andprismarefused to run beside the second copy withCLI.SECOND_PACKAGE_COPY. The Vite plugin keeps its import path, and its types now work with Vite 7 as well as Vite 8. A workspace whose packages resolve different TypeScript versions still gets one copy per version. (#31333) - The rc.25 to rc.26 upgrade scripts: the two that read code with TypeScript stop with a clear message on TypeScript 7, which has no compiler API, and say how to run them with TypeScript 5; no script reports an unexpected error as "changed no file". In a git repository, the scripts skip what git ignores, except that the two stored-file scripts still upgrade a migrations folder git ignores.
contract-signature-nameslists the lines of Markdown that name an old code, instead of rewriting them.stored-files-format-versionchecks every file before it writes any. (#31333) - The rc.25 to rc.26 guides are corrected. They say which
prismaversion to install, to run the stored-file scripts once per Prisma project folder, not to run a plannedmigration.tsagain, how to sign databases in a deploy with a check that signs only a database the upgrade has not reached, the order for an application that CI deploys on every merge, which databases need signing, what read-only checks report during the switch, which type errors clear aftercontract emit, and that a guardedupdateAll()ordeleteAll()now runs one statement fewer. (#31333)