github prisma/orm v8.0.0-rc.27

pre-release52 minutes ago

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 fns carries the contract's boolean codec. BooleanCodecType and the ORM client's FunctionCondition now take the contract's codec types, so a use without type arguments no longer compiles. On MySQL, MariaDB and SQLite, a condition such as fns.eq(...) is typed with the target's boolean codec (mysql/boolean@1 or sqlite/boolean@1) instead of pg/bool@1, and a condition selected as a column reads as true or false (or null), where it read as '1'/'0' on MySQL and MariaDB and 1/0 on SQLite. A boolean column is accepted wherever a condition is. createFunctions and createAggregateFunctions are no longer published; take fns from a query callback. See boolean-codec-type-takes-codec-types, function-condition-takes-codec-types, condition-codec-on-mysql-and-sqlite, projected-condition-reads-as-boolean and functions-builders-no-longer-published in the app guide and the extension guide. (#31296)

Fixes

  • prisma contract emit gives 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, and prisma db verify then failed with CONTRACT.SIGNATURE_MISMATCH: "The database is signed for other capabilities". contract emit now updates that snapshot's requiredCapabilities and profileHash, and its contract.d.ts, and reports it. Commit the snapshot it updates, and sign each database created on 8.0.0-rc.26 with prisma db sign --no-advance-ref. The Vite plugin does not update it. See app-snapshot-gets-emitted-profile in the app guide. (#31333)
  • pnpm installs one copy of @prisma/orm-toolchain. The toolchain no longer has vite as an optional peer, and depends on typanion, which clipanion needs. Each had resolved differently in each package of a pnpm workspace, giving one copy of the toolchain per resolution, and prisma refused to run beside the second copy with CLI.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-names lists the lines of Markdown that name an old code, instead of rewriting them. stored-files-format-version checks every file before it writes any. (#31333)
  • The rc.25 to rc.26 guides are corrected. They say which prisma version to install, to run the stored-file scripts once per Prisma project folder, not to run a planned migration.ts again, 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 after contract emit, and that a guarded updateAll() or deleteAll() now runs one statement fewer. (#31333)

Don't miss a new orm release

NewReleases is sending notifications on new releases.