github prisma/prisma 2.0.0-preview014

latest releases: 5.13.0, 5.12.1, 5.12.0...
pre-release4 years ago

Today, we are issuing the fourteenth Preview release: 2.0.0-preview014 (short: preview014).

Note that we adjusted the versioning schema (from 2.0.0-preview-14 to 2.0.0-preview014) in order to fully comply to the semver spec.

Breaking changes

Removing the nexus-prisma generator from the Prisma schema

In version 2.0.0-preview014, the nexus-prisma generator is not available any more. When using nexus-prisma, you can install it as an npm dependency, just like you do with other libraries. Find an updated example of how to using nexus-prisma to build a GraphQL API here.

Self-relations must be disambiguated with the @relation attribute

In previous releases, this used to be a valid schema:

model User {
  id         String @id @default(cuid())
  marriedTo  User?
  spouseOf   User?
}

In previous versions, it was inferred that both relation fields, marriedTo and spouseOf, would belong to the same relation, i.e. it was interpreted as follows:

model User {
  id         String @id @default(cuid())
  marriedTo  User? @relation("MarriedUsers")
  spouseOf   User? @relation("MarriedUsers")
}

From this release onwards, adding the @relation attribute is required in order to disambiguate this relation.

The platforms field of generators in the schema has been renamed to binaryTargets

generator photon {
  provider = "photonjs"
  platforms = ["darwin"]
}

now becomes

generator photon {
  provider = "photonjs"
  binaryTargets = ["darwin"]
}

pinnedPlatform is now an env var

If you want to specify the concrete binary target or a binary path for the query engine, you can use the PRISMA_QUERY_ENGINE_BINARY env var. Just pass it in to the process running Photon.js and it will be picked up.

In order to also customize the Lift engine path, you can run the prisma2 cli while providing PRISMA_MIGRATION_ENGINE_BINARY.

Major changes

For this release, we have invested a lot into fixing bugs across the stack. Try it out yourself:

npm install -g prisma2
prisma2 init hello-world

Please share your feedback and report any issues you might encounter!

Fixes and improvements per Prisma 2 repository

prisma2

photonjs

lift

studio

prisma-engine

Don't miss a new prisma release

NewReleases is sending notifications on new releases.