Prisma

Latest version: v0.15.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 27 of 44

2.0.0preview019

Today, we are issuing the nineteenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `2.0.0-preview019` (short: `preview019`). In case you've missed it, you can [read about the current state of Prisma 2 on our blog](https://www.prisma.io/blog/state-of-prisma-2-december-rcrwcqyu655e/).

This release has a number of breaking changes, be sure to read the notes [below](breaking-changes
) before upgrading!
**You can find a full upgrade guide [here](https://github.com/prisma/prisma2/blob/master/docs/upgrade-guides/upgrading-to-preview019.md)**.

Note that we recently adjusted the versioning schema in order to fully comply to the [semver](https://semver.org/) spec (the first release with the new version schema was `2.0.0-preview014`).

Breaking changes

Support for native scalar lists (arrays) in the Prisma schema

Prisma's scalar list support for MySQL and SQLite is removed in this version. For PostgreSQL, Prisma is now mapping scalar lists in the Prisma schema to [PostgreSQL arrays](https://www.postgresql.org/docs/9.1/arrays.html).

Here is an example of a native scalar list (of type `boolean`) in the Prisma schema:

prisma
model User {
id Int id
name String default("")
coinflips Boolean[]
}


You can find the workflows for upgrading Prisma for your database [here](https://github.com/prisma/prisma2/blob/master/docs/upgrade-guides/upgrading-to-preview019.md).

Make ID handling for `Int` and `String` consistent

Previously, the way how Prisma handled IDs was a bit inconsistent. For example, this was allowed:

prisma
model User {
id Int id
}


But this wasn't:

prisma
model User {
id String id
}


There was a difference in how Prisma handled IDs of type `String` and type `Int`.

In the first case, Prisma added the behaviour of auto-incrementing IDs (i.e. IDs received a _default value_), so it wasn't required to provide an `id` value when new `User` records were created via the generated Photon.js API.

The same `User` model with `id` field of type `Int` now **will not** receive any default, auto-incrementing values for `id` any more. Instead `id` values must be explicitly provided when creating new `User` records via Photon.js:

ts
// Before, this was possible
const user = await photon.users.create()

// Now you need to provide an `id`
const user = await photon.users.create({
data: {
id: 42
}
})


In most cases, you'll want to retain the previous functionality though. To get this functionality, you need to add the `default(autoincrement())` to the `id` field:

prisma
model User {
id Int id default(autoincrement())
}



Disallow `id` and `unique` on the same field

Previously it was possible to add `unique` attribute to a field that was already annotated with `id`:

prisma
model User {
id Int id unique
}


This is now forbidden since uniqueness is already implied by `id`:

prisma
model User {
id Int id
}


Breaking change in Lift migrations

This release contains a breaking change to the way how Lift stores the migration history. In order to use Lift with the newest version, you have to:

- manually delete the `migrations` folder from the file system
- truncate or delete Lift's `_Migrations` table, e.g. using `TRUNCATE _Migration;`


Fixes and improvements per Prisma Framework repository

`prisma2`

- [Document unix socket usuage](https://github.com/prisma/prisma2/issues/1121)
- [`lift up` not applying migrations to fresh database, whilst `prisma2 dev` does?](https://github.com/prisma/prisma2/issues/1099)
- [Introspection panic on a non empty database](https://github.com/prisma/prisma2/issues/1092)
- [Introspection panics on an empty database](https://github.com/prisma/prisma2/issues/1087)
- [Prisma 2 init with SQLite works but throws an error](https://github.com/prisma/prisma2/issues/1085)
- [prisma2 init crashing](https://github.com/prisma/prisma2/issues/1068)
- [Document multiple default(now()) restrictions](https://github.com/prisma/prisma2/issues/1062)
- [[Introspection] Panic: FK to non existent table](https://github.com/prisma/prisma2/issues/1107)
- [[Introspection] Remove default from scalar lists](https://github.com/prisma/prisma2/issues/1110)
- [[Introspection] PrismaModels should be able to handle relation field as Id](https://github.com/prisma/prisma2/issues/1115)
- [Could not install prisma2 using volta](https://github.com/prisma/prisma2/issues/1054)
- [Lift and dev, popup to create a new database missing](https://github.com/prisma/prisma2/issues/1051)
- [Automatically clean prisma2 binary cache](https://github.com/prisma/prisma2/issues/988)
- [Rust panic with Chinook and SQLite](https://github.com/prisma/prisma2/issues/975)
- [Improve install behavior on linux](https://github.com/prisma/prisma2/issues/944)
- [prisma2 dev cannot find heroku postgres database](https://github.com/prisma/prisma2/issues/869)
- [Existing database with MySQL doesn't print](https://github.com/prisma/prisma2/issues/778)
- [Error in migration engine when using with sample Chinook dataset](https://github.com/prisma/prisma2/issues/724)
- [Make error text more helpful](https://github.com/prisma/prisma2/issues/693)
- [[Docs] Query Builder](https://github.com/prisma/prisma2/issues/689)
- [Error: Unknown database type postgres:](https://github.com/prisma/prisma2/issues/599)
- [Unix socket connection not working](https://github.com/prisma/prisma2/issues/525)
- [`prisma2` commands could fail more gracefully when query and migration engine are not present](https://github.com/prisma/prisma2/issues/508)
- [Consistent binary names](https://github.com/prisma/prisma2/issues/366)

`photonjs`

- [Photon's error improvement on missing binary](https://github.com/prisma/photonjs/issues/358)
- [Photon facade with netlify](https://github.com/prisma/photonjs/issues/324)
- [Photon facade with zeit now](https://github.com/prisma/photonjs/issues/323)
- [Document Photon and environment variables behavior](https://github.com/prisma/photonjs/issues/354)
- [Make prisma2 an optional peer dependency](https://github.com/prisma/photonjs/issues/313)
- [prisma/photon installation hangs](https://github.com/prisma/photonjs/issues/310)
- [PhotonJS fails to load environment variables from env file](https://github.com/prisma/photonjs/issues/352)
- [Multiple calls to disconnect should be noops](https://github.com/prisma/photonjs/issues/281)
- [Invalid `ctx.photon.posts.create()` invocation](https://github.com/prisma/photonjs/issues/279)
- [Regenerating Photon causes API in development to crash](https://github.com/prisma/photonjs/issues/234)


`lift`

- [Lift is trying to recreate type aliases](https://github.com/prisma/lift/issues/225)
- [Migration Readme Incorrect](https://github.com/prisma/lift/issues/222)
- [Update printMigrationReadme.ts](https://github.com/prisma/lift/pull/198)
- [support <inc|name|timestamp> in up/down cli](https://github.com/prisma/lift/issues/156)

`prisma-engine`

- [[Introspection] "called `Option::unwrap()` on a `None` value", PrismaModels fails on unwrap](https://github.com/prisma/prisma-engine/issues/265)
- [[Introspection] boolean id](https://github.com/prisma/prisma-engine/issues/258)
- [Datamodel Parser: Native Scalar Lists](https://github.com/prisma/prisma-engine/issues/193)
- [EPIC: Native Scalar Lists](https://github.com/prisma/prisma-engine/issues/192)


2.0.0-preview018.2
Fixes
- [Prisma 2 init with SQLite works but throws an error](https://github.com/prisma/prisma2/issues/1085)
- [Could not install prisma2 using volta](https://github.com/prisma/prisma2/issues/1054)
- [Lift and dev, popup to create a new database missing](https://github.com/prisma/prisma2/issues/1051)
- [Make prisma2 an optional peer dependency](https://github.com/prisma/photonjs/pull/313)
- [Migration Readme Incorrect](https://github.com/prisma/lift/issues/222)
- [Automatically clean prisma2 binary cache](https://github.com/prisma/prisma2/issues/988)
- [Multiple calls to disconnect should be noops](https://github.com/prisma/photonjs/issues/281)
- [Invalid `ctx.photon.posts.create()` invocation](https://github.com/prisma/photonjs/issues/279)
- [Update printMigrationReadme.ts](https://github.com/prisma/lift/pull/198)
- [Error: Unknown database type postgres:](https://github.com/prisma/prisma2/issues/599)
- [Unix socket connection not working](https://github.com/prisma/prisma2/issues/525)
- [Lift seems to be broken](https://github.com/prisma/lift/issues/241)
- [Photon facade with zeit now](https://github.com/prisma/photonjs/issues/323)

2.0.0-preview018.1
Fixes
- [prisma2 init crashing 1068](https://github.com/prisma/prisma2/issues/1068)

2.0.0preview018

Today, we are issuing the eighteenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `2.0.0-preview018` (short: `preview018`).

Note that we recently adjusted the versioning schema in order to fully comply to the [semver](https://semver.org/) spec (the first release with the new version schema was `2.0.0-preview014`).

Breaking changes

We removed the `prisma2 convert` command from the Prisma Framework CLI. If you're upgrading from Prisma 1 to the Prisma Framework, you can use [introspection](https://github.com/prisma/prisma2/blob/master/docs/introspection.md) to generate your initial Prisma schema.

Fixes and improvements per Prisma Framework repository

`prisma2`

- [Updates to schema.prisma in dev mode require for the studio to work](https://github.com/prisma/prisma2/issues/1006)
- [[2.0.0-preview017, Win10] Error with global npm install of 'prisma2' CLI](https://github.com/prisma/prisma2/issues/987)
- [[2.0.0-preview017] Error: Get config SyntaxError: Unexpected token P in JSON at position 0](https://github.com/prisma/prisma2/issues/985)
- [Document .count() method](https://github.com/prisma/prisma2/issues/965)
- [PRISMA_QUERY_ENGINE_BINARY being ignored](https://github.com/prisma/prisma2/issues/1034)
- [`prisma2 lift save` creates two new `.db` files for SQLite](https://github.com/prisma/prisma2/issues/936)
- [Scalar array query missing order clause](https://github.com/prisma/prisma2/issues/930)
- [debug mode docs don't match types](https://github.com/prisma/prisma2/issues/911)
- [Update TypeScript CI setup](https://github.com/prisma/prisma2/issues/906)
- [Documentation to be added for using Array of primitives](https://github.com/prisma/prisma2/issues/853)
- [Cannot use DateTime, getting error: Provided Json, expected DateTime](https://github.com/prisma/prisma2/issues/809)
- [Transactions](https://github.com/prisma/prisma2/issues/449)


`photonjs`

- [Remove RecordDoesNotExist javascript code](https://github.com/prisma/photonjs/issues/304)
- [just](https://github.com/prisma/photonjs/issues/298)
- [Add a _fetcher.request call in Client constructor](https://github.com/prisma/photonjs/issues/287)
- [Update common.ts](https://github.com/prisma/photonjs/issues/285)
- [Instructions to first install photonjs and then npm install](https://github.com/prisma/photonjs/issues/99)
- [Update _setup-1.md](https://github.com/prisma/photonjs/issues/44)


`lift`

- [Migrating an optional to a required self-relation where null-value already exist succeeds](https://github.com/prisma/lift/issues/215)


`prisma-engine`

- [Query Engine: Performance Improvement by removing implicit ORDER BY](https://github.com/prisma/prisma-engine/issues/178)
- [VSCode Extension: unique is not supported yet](https://github.com/prisma/prisma-engine/issues/212)
- [VSCode Extension: Support multiple index Statements](https://github.com/prisma/prisma-engine/issues/211)
- [Introspection Engine: Implement Errors Spec 129](https://github.com/prisma/prisma-engine/issues/131)
- [Migration Engine: Implement Errors Spec](https://github.com/prisma/prisma-engine/issues/130)


2.0.0-preview017.2
Fixes
- [Prisma2 dev 'cannot destructure property "dmmf"'](https://github.com/prisma/prisma2/issues/999)
- [Error with Prisma2 installation on Linux](https://github.com/prisma/prisma2/issues/993)

2.0.0-preview017.1
Fixes
As the last preview release [Preview 17](https://github.com/prisma/prisma2/releases/tag/2.0.0-preview017) introduced a lot of change with a lot of potential side effects, also a few small bugs got introduced.

These bugs are fixed by this patch.

The issues that got tackled by this patch:
- [[2.0.0-preview017] Error: Get config SyntaxError: Unexpected token P in JSON at position 0](https://github.com/prisma/prisma2/issues/985)
- [[2.0.0-preview017, Win10] Error with global npm install of 'prisma2' CLI](https://github.com/prisma/prisma2/issues/987)
- [prisma/photon installation hangs](https://github.com/prisma/photonjs/issues/310)
- [Updates to schema.prisma in dev mode require for the studio to work](https://github.com/prisma/prisma2/issues/1006)

2.0.0preview017

Today, we are issuing the seventeenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `2.0.0-preview017` (short: `preview017`). Note that this release includes a **major breaking change** with respect to where Photon.js is being generated and how it's imported into your code. Read more below!

Note that we recently adjusted the versioning schema in order to fully comply to the [semver](https://semver.org/) spec (the first release with the new version schema was `2.0.0-preview014`).

Breaking changes

Photon.js generation and usage

With this release, we're implementing the [facade package `prisma/photon`](https://github.com/prisma/photonjs/issues/261) for Photon.js. This means, instead of generating Photon.js into `node_modules/generated/photon`, it is now being generated into `node_modules/prisma/photon`.

**Furthermore, you now must add the `prisma/photon` package to your project dependencies**:


npm install prisma/photon


Consequently, the `Photon` constructor is now imported from `prisma/photon` into your code:

diff
- import { Photon } from 'generated/photon'
+ import { Photon } from 'prisma/photon'


Also note that **the versions of `prisma/photon` and your `prisma2` CLI installation must be the same**! It is therefore recommended to add `prisma2` as a development dependency to you project. Global installations of `prisma2` are discouraged because it's more difficult to keep them in sync with individual projects.

You can add `prisma2` as a development dependeency as follows:


npm install prisma2 --save-dev


You can now invoke this local `prisma2` installation using `npx`:


npx prisma2


Usage of custom binaries in Photon.js

If you're using the `platforms` field on your Photon.js generator to explicitly specify a build target for the binaries that are used by Photon.js, you might need to update the naming of the binaries. Here's how the names have changed:

| Before | After |
| --- | --- |
| `windows` | `windows` |
| `darwin` | `darwin` |
| `linux-glibc-libssl1.0.1` | `debian-openssl-1.0.x` |
| `linux-glibc-libssl1.0.2` | `debian-openssl-1.0.x` |
| `linux-glibc-libssl1.1.0` | `debian-openssl-1.1.x` |
| `linux-glibc-libssl1.1.1` | `debian-openssl-1.1.x` |

If you're using a [RHEL](https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux)-based systems (Fedora, Centos, etc.), replace `debian` with `rhel`, e.g. `rhel-openssl-1.1.x`.

You can learn more about this in the [spec](https://github.com/prisma/specs/blob/master/binaries/Readme.md#binary-build-targets).

Fixes and improvements per Prisma Framework repository

`prisma2`

- [CLI: Rename Prisma 2 to Prisma Framework](https://github.com/prisma/prisma2/issues/940)
- [RecordDoesNotExist Comeback!](https://github.com/prisma/prisma2/issues/914)
- [prisma2 init flow is throwing "File name too long"](https://github.com/prisma/prisma2/issues/904)
- [Query was empty error on Preview 16](https://github.com/prisma/prisma2/issues/902)
- [Type Aliases not working](https://github.com/prisma/prisma2/issues/896)
- [Docs for the `postinstall` script of the `prisma2` npm package](https://github.com/prisma/prisma2/issues/895)
- [Document how to build binaries in debug mode](https://github.com/prisma/prisma2/issues/857)
- [Remove stability limitation docs](https://github.com/prisma/prisma2/issues/852)
- [Error with Prisma v15: can't find prisma.schema](https://github.com/prisma/prisma2/issues/824)
- [CodeSandBox core dump investigation](https://github.com/prisma/prisma2/issues/783)
- [Error: QueryError(QueryError(UniqueConstraintViolation { field_name: "A, _MovieToWriter" }](https://github.com/prisma/prisma2/issues/768)
- [Document native import/export workflows](https://github.com/prisma/prisma2/issues/746)
- [End to end testing of CLI init flows](https://github.com/prisma/prisma2/issues/615)
- [Contribution documentation: Local setup to be able to develop and use Prisma](https://github.com/prisma/prisma2/issues/574)
- [Error: spawn E2BIG](https://github.com/prisma/prisma2/issues/254)


`photonjs`

- [Photon.js not usable with Heroku DB and ZEIT Now V2 due do DB connection limit](https://github.com/prisma/photonjs/issues/289)
- [The findOne throws RecordDoesNotExist in alpha.282](https://github.com/prisma/photonjs/issues/288)

`lift`

- [Multiple self relations make `lift save` panic](https://github.com/prisma/lift/issues/164)

`prisma-engine`

- [Build pipeline rework.](https://github.com/prisma/prisma-engine/issues/177)
- [Query engine: integer fields return floats](https://github.com/prisma/prisma-engine/issues/160)
- [Add instructions for compiling binaries in debug mode to README](https://github.com/prisma/prisma-engine/issues/153)
- [Fix joins against the same table when not necessary](https://github.com/prisma/prisma-engine/issues/127)
- [Introspection Engine: Implement and Test `getDatabaseMetadata` and `listDatabases`](https://github.com/prisma/prisma-engine/issues/123)
- [Refactoring: Centralize SQL connection handling into central crate](https://github.com/prisma/prisma-engine/issues/109)
- [fix: return type for findMany* should be non-nullable](https://github.com/prisma/prisma-engine/issues/52)
- [Build OS-based binaries instead of platform-based](https://github.com/prisma/prisma-engine/issues/37)



2.0.0-preview016.2
Fixes
- Fixes https://github.com/prisma/prisma2/issues/914


2.0.0-preview016.1
Fixes
This release fixes a regression introduced in https://github.com/prisma/prisma2/releases/tag/2.0.0-preview016

- [prisma2 init flow is throwing "File name too long"](https://github.com/prisma/prisma2/issues/904)

2.0.0preview016

Today, we are issuing the sixteenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `2.0.0-preview016` (short: `preview016`).

Note that we recently adjusted the versioning schema in order to fully comply to the [semver](https://semver.org/) spec (the first release with the new version schema was `2.0.0-preview014`).

Also a huge shoutout to williamluke4 for his work on this PR: [fix(Engine Commands) Pass JSON File to Query Engine](https://github.com/prisma/prisma2/pull/841) 🙌

Major changes

This release contains major improvements to Photon's query engine. The biggest improvement here is that we're lifting the limitation that the query engine is only able to [process one request at a time](https://github.com/prisma/prisma2/issues/420). In practice, this means that the query engine request throughput vastly increases. We see this as a major step towards making Photon.js production-ready! 🎉

Breaking changes

Due to a major refactoring in Lift's migration engine, your migrations are likely going to break if you upgrade to `preview016` with an error similar to this: `Error parsing the migration steps: Error("unknown field 'name', expected 'model'", line: 1, column: 59)`.

To get rid of this error, you'll need to manually delete the generated `migrations` folder from your file system and drop the `_Migration` table in your database.

Fixes and improvements per Prisma Framework repository

`prisma2`

- [Error While running `prisma2 init hello-prisma` on macOS mojave](https://github.com/prisma/prisma2/issues/823)
- [Do not count .DS_Store as a file to disqualify a folder during `prisma2 init` with a Starter Kit](https://github.com/prisma/prisma2/issues/762)
- [Create architecture diagram for the Prisma Framework internals](https://github.com/prisma/prisma2/issues/747)
- [Prisma 2 on Centos 7](https://github.com/prisma/prisma2/issues/744)
- [Make Prisma generate independent of environment](https://github.com/prisma/prisma2/issues/593)
- [Error: spawn E2BIG](https://github.com/prisma/prisma2/issues/254)
- [Remove limitation on 1 request at at time](https://github.com/prisma/prisma2/issues/420)

`photonjs`

- [Filtering `null` relationships is not possible](https://github.com/prisma/photonjs/issues/271)
- [DateTime not converted to Date when using `where`](https://github.com/prisma/photonjs/issues/267)
- [Array types](https://github.com/prisma/photonjs/issues/259)

`prisma-engine`

- [Introspection Engine: test against our collection of database schema examples](https://github.com/prisma/prisma-engine/issues/122)
- [Introspection Engine: Add support for MySQL](https://github.com/prisma/prisma-engine/issues/121)
- [Introspection Engine: extend tests for MySQL](https://github.com/prisma/prisma-engine/issues/120)
- [Introspection Engine: extend tests for Postgres](https://github.com/prisma/prisma-engine/issues/119)
- [Query Engine: Asyncification](https://github.com/prisma/prisma-engine/issues/116)
- [Query Engine: Find a replacement for our current logger (performance)](https://github.com/prisma/prisma-engine/issues/91)
- [Migration Engine: Implement new diffing approach to enable custom types](https://github.com/prisma/prisma-engine/issues/85)

2.0.0preview015

Today, we are issuing the fifteenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `2.0.0-preview015` (short: `preview015`).

Note that we recently adjusted the versioning schema in order to fully comply to the [semver](https://semver.org/) spec (the first release with the new version schema was `2.0.0-preview014`).

Major changes

Lift now features an explicit UI that warns about destructive changes before performing a schema migration: (Right now column and table dropping are recognized)

<img width="977" alt="Screenshot 2019-10-22 at 16 19 26" src="https://user-images.githubusercontent.com/4058327/67297589-683f1500-f4ea-11e9-8c3c-849994e5a81c.png">


Breaking changes

Photon.js now maps `DateTime` from the Prisma schema to `Date` in JavaScript

Assume you have the following Prisma model:

prisma
model Post {
id String default(cuid()) id unique
createdAt DateTime default(now())
updatedAt DateTime updatedAt
title String
}


The Photon.js generator now sets the types of the `createdAt` and `updatedAt` fields to `Date` instead of `string`:

ts
export declare type Post = {
id: string;
createdAt: Date;
updatedAt: Date;
title: string;
}


`findOne` doesn't throw any more but has optional return type

Based on [this](https://github.com/prisma/photonjs/issues/245) issue, we decided to adjust the Photon.js API for `findOne` calls. Instead of throwing an exception when there is no record that meets the specified `where` condition for a `findOne` call, it now returns `null`.

Assume again the same Prisma model as before:

prisma
model Post {
id String default(cuid()) id unique
createdAt DateTime default(now())
updatedAt DateTime updatedAt
title String
}


So, in your application code you might want to adjust the `catch` calls to explicit checks for `null`:

**Before**

ts
try {
const post = await photon.posts.findOne({
where: { id }
})
// ... do something with `post`
} catch(e) {
console.log(`Did not find record with ID: ${id}`)
}


**After**

ts
const post = await photon.posts.findOne({
where: { id }
})
if (post === null) {
console.log(`Did not find record with ID: ${id}`)
return
}
// ... do something with `post`


Fixes and improvements per Prisma Framework repository

`prisma2`

- [Cursor does not work in `alpha.241`](https://github.com/prisma/prisma2/issues/753)
- [Docs: Please document how to handle DateTime values with Photon.js](https://github.com/prisma/prisma2/issues/743)
- [More inclusive language in docs](https://github.com/prisma/prisma2/issues/722)
- [Telemetry: Error report ID](https://github.com/prisma/prisma2/issues/705)
- [Postgres: A database with that name doesn't exist at xx.xx.xx.xx using 2.0.0-preview013.3](https://github.com/prisma/prisma2/issues/694)
- [`init` flow doesn't show instruction to navigate into new directory](https://github.com/prisma/prisma2/issues/684)
- [fix: prisma2 introspect for mysql database](https://github.com/prisma/prisma2/issues/683)
- [`prisma2 dev`: Asks to save changes into a migration file by running `prisma2 lift save` but gives `Everything up-to-date` in terminal](https://github.com/prisma/prisma2/issues/651)
- [Telemetry prompt options don't work on Windows (cursor keys do nothing)](https://github.com/prisma/prisma2/issues/617)
- [Limitations: nested write vs. nested mutations](https://github.com/prisma/prisma2/issues/602)
- [Conflicting "Make sure to adjust the generator configuration in the schema.prisma file:" error message](https://github.com/prisma/prisma2/issues/589)
- [[Windows] `prisma2 init` fails with `Error: Can't find Python executable "python", you can set the PYTHON env variable.`](https://github.com/prisma/prisma2/issues/550)


`photonjs`

- [DateTime should be mapped to Date](https://github.com/prisma/photonjs/issues/260)
- [`.count()` returns `null` for empty tables](https://github.com/prisma/photonjs/issues/253)
- [Select in finds methods optional fields](https://github.com/prisma/photonjs/issues/256)
- [findOne: Stop throwing an error when no record found](https://github.com/prisma/photonjs/issues/245)
- [Possibly wrong type generation for `after` argument in findMany method (Postgres)](https://github.com/prisma/photonjs/issues/241)
- [`Field does not exist on enclosing type.` When using most filters (some, etc)](https://github.com/prisma/photonjs/issues/222)

`lift`

- [README contains wrong link to schema](https://github.com/prisma/lift/issues/166)
- [Implement Display of Destructive Changes](https://github.com/prisma/lift/issues/146)

`prisma-engine`

- [Arity of implicit relations: Change Unspecified relations from one-to-one's to one-to-many's](https://github.com/prisma/prisma-engine/issues/102)
- [Introspection Engine: Multi field id criterion (Multi column PKs)](https://github.com/prisma/prisma-engine/issues/69)
- [Introspection Engine: Multi field unique](https://github.com/prisma/prisma-engine/issues/61)
- [Fix MySQL SqlSchemaDescriber on MySQL 8](https://github.com/prisma/prisma-engine/issues/47)


2.0.0-preview014.2
Fixes
- [Postgres: A database with that name doesn't exist at xx.xx.xx.xx using 2.0.0-preview013.3](https://github.com/prisma/prisma2/issues/694)
- [Field does not exist on enclosing type.` When using most filters (some, etc)](https://github.com/prisma/photonjs/issues/222)
- [init` flow doesn't show instruction to navigate into new directory](https://github.com/prisma/prisma2/issues/684)
- [Telemetry: Error report ID](https://github.com/prisma/prisma2/issues/705)
- [Select in finds methods optional fields](https://github.com/prisma/photonjs/issues/256)
- [`.count()` returns `null` for empty tables](https://github.com/prisma/photonjs/issues/253)
- [README contains wrong link to schema](https://github.com/prisma/lift/issues/166)

2.0.0-preview014.1
Fixes
This patch release fixes a bug when using the `native` `binaryTarget` https://github.com/prisma/prisma2/issues/750

2.0.0preview014

Today, we are issuing the fourteenth [Preview release](https://github.com/prisma/prisma2/blob/master/docs/releases.md#preview): `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](https://semver.org/) 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`](https://github.com/prisma-labs/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](https://github.com/prisma/prisma-examples/tree/prisma2/typescript/graphql).

Self-relations must be disambiguated with the `relation` attribute

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

prisma
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:

prisma
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`

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

now becomes
prisma
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](https://github.com/prisma/prisma2/blob/master/docs/prisma2-feedback.md) and [report any issues](https://github.com/prisma/prisma2/issues) you might encounter!

Fixes and improvements per Prisma 2 repository

`prisma2`

- [Example scripts still use `2.0.0-preview-12` in `package.json`](https://github.com/prisma/prisma2/issues/667)
- ["Learn more" link in telemetry modal is broken](https://github.com/prisma/prisma2/issues/624)
- [Increase heap size for spawned generator process](https://github.com/prisma/prisma2/issues/620)
- [Init flow "printSchema is not a function"](https://github.com/prisma/prisma2/issues/616)
- [Support custom SSL certificates in the connection string](https://github.com/prisma/prisma2/issues/568)
- [Prisma 2 is failing to migrate remote database (DO hosted instance)](https://github.com/prisma/prisma2/issues/562)
- [Prisma lift error: ambiguous self-relation detected](https://github.com/prisma/prisma2/issues/488)
- [`prisma2 init` does not find `ts-node` when using starter kit "GraphQL API (+ Auth)"](https://github.com/prisma/prisma2/issues/482)
- [Increase heap size of the generate compilation process](https://github.com/prisma/prisma2/issues/621)
- [Rename platforms to binaryTargets](https://github.com/prisma/prisma2/issues/553)
- [Streamline generator architecture](https://github.com/prisma/prisma2/issues/530)
- [npm install -g prisma2` also downloads migration engine, but doesn't mention it](https://github.com/prisma/prisma2/issues/507)
- [Custom binary platforms for query engine](https://github.com/prisma/prisma2/issues/343)

`photonjs`

- [Photon filters `in` prop missing `null` support](https://github.com/prisma/photonjs/issues/242/)

`lift`

- [Migration causes 'Duplicate key name'](https://github.com/prisma/lift/issues/148/)

`studio`

- [Easy browser-based development setup](https://github.com/prisma/lift/issues/162/)

`prisma-engine`

- [Fix DeadlockSpec](https://www.github.com/prisma/prisma-engine/issues/83)
- [EPIC: Benchmarking 1/x](https://www.github.com/prisma/prisma-engine/issues/76)
- [Datamodel Parser: Multi field id criterion (Multi column PKs)](https://www.github.com/prisma/prisma-engine/issues/66)
- [Migration Engine: Multi field unique](https://www.github.com/prisma/prisma-engine/issues/59)
- [All Engines should print commit hash on startup](https://www.github.com/prisma/prisma-engine/issues/35)


2.0.0-preview013.3
Fixes
- [`prisma2 dev` hangs after creating SQLite database](https://github.com/prisma/prisma2/issues/641)

Change in versioning scheme
We changed the versioning scheme from `2.0.0-preview-xx.y` to `2.0.0-previewxx.y`, as otherwise commands like `yarn upgrade` don't recognize the new versions, as semver couldn't parse our old version scheme.

2.0.0-preview-13.2
Fixes
- [`prisma2 init` does not find `ts-node` when using starter kit "GraphQL API (+ Auth)"](https://github.com/prisma/prisma2/issues/482)

2.0.0-preview-13.1
Fixes
In this patch release, we reintroduced the stack trace in case of an unexpected error to the terminal output:

![image](https://user-images.githubusercontent.com/1094804/65869684-33242480-e37b-11e9-8f93-4abe6ec0425d.png)

This is a necessity for debugging.

Page 27 of 44

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.