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
- Example scripts still use
2.0.0-preview-12
inpackage.json
- "Learn more" link in telemetry modal is broken
- Increase heap size for spawned generator process
- Init flow "printSchema is not a function"
- Support custom SSL certificates in the connection string
- Prisma 2 is failing to migrate remote database (DO hosted instance)
- Prisma lift error: ambiguous self-relation detected
prisma2 init
does not findts-node
when using starter kit "GraphQL API (+ Auth)"- Increase heap size of the generate compilation process
- Rename platforms to binaryTargets
- Streamline generator architecture
- npm install -g prisma2` also downloads migration engine, but doesn't mention it
- Custom binary platforms for query engine