diff --git a/content/200-orm/050-overview/500-databases/300-postgresql.mdx b/content/200-orm/050-overview/500-databases/300-postgresql.mdx
index 664b821e70..a9985c59fc 100644
--- a/content/200-orm/050-overview/500-databases/300-postgresql.mdx
+++ b/content/200-orm/050-overview/500-databases/300-postgresql.mdx
@@ -161,10 +161,10 @@ The following arguments can be used:
| `host` | No | | Points to a directory that contains a socket to be used for the connection |
| `socket_timeout` | No | | Maximum number of seconds to wait until a single query terminates |
| `pgbouncer` | No | `false` | Configure the Engine to [enable PgBouncer compatibility mode](/orm/prisma-client/setup-and-configuration/databases-connections/pgbouncer) |
-| `statement_cache_size` | No | `100` | Since 2.1.0: Specifies the number of [prepared statements](#prepared-statement-caching) cached per connection |
-| `application_name` | No | | Since 3.3.0: Specifies a value for the application_name configuration parameter |
-| `channel_binding` | No | `prefer` | Since 4.8.0: Specifies a value for the channel_binding configuration parameter |
-| `options` | No | | Since 3.8.0: Specifies command line options to send to the server at connection start |
+| `statement_cache_size` | No | `100` | Specifies the number of [prepared statements](#prepared-statement-caching) cached per connection |
+| `application_name` | No | | Specifies a value for the application_name configuration parameter |
+| `channel_binding` | No | `prefer` | Specifies a value for the channel_binding configuration parameter |
+| `options` | No | | Specifies command line options to send to the server at connection start |
As an example, if you want to connect to a schema called `myschema`, set the connection pool size to `5` and configure a timeout for queries of `3` seconds. You can use the following arguments:
diff --git a/content/200-orm/050-overview/500-databases/500-sqlite.mdx b/content/200-orm/050-overview/500-databases/500-sqlite.mdx
index 6218a8b124..2393683418 100644
--- a/content/200-orm/050-overview/500-databases/500-sqlite.mdx
+++ b/content/200-orm/050-overview/500-databases/500-sqlite.mdx
@@ -65,7 +65,7 @@ When using `enum` fields in SQLite, be aware of the following:
SQLite is a loosely-typed database. If your Schema has a field of type `Int`, then Prisma ORM prevents you from inserting a value larger than an integer. However, nothing prevents the database from directly accepting a bigger number. These manually-inserted big numbers cause rounding errors when queried.
-To avoid this problem, Prisma ORM 4.0.0 and later checks numbers on the way out of the database to verify that they fit within the boundaries of an integer. If a number does not fit, then Prisma ORM throws a P2023 error, such as:
+To avoid this problem, Prisma ORM checks numbers on the way out of the database to verify that they fit within the boundaries of an integer. If a number does not fit, then Prisma ORM throws a P2023 error, such as:
```
Inconsistent column data: Conversion failed:
diff --git a/content/200-orm/050-overview/500-databases/800-sql-server/index.mdx b/content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
index 50138a1066..7c765ae3e6 100644
--- a/content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
+++ b/content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
@@ -70,7 +70,7 @@ sqlserver://HOST[:PORT];database=DATABASE;user={MyServer/MyUser};password={ThisI
| `socketTimeout` | No | | Number of seconds to wait for each query to succeed. |
| `isolationLevel` | No | | Sets [transaction isolation level](https://learn.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-ver15). |
| `poolTimeout` | No | `10` | Maximum number of seconds to wait for a new connection from the pool. If all connections are in use, the database will return a `PoolTimeout` error after waiting for the given time. |
-|
`ApplicationName`
`Application Name`
(case insensitive) | No | | Sets the application name for the connection. Since version 2.28.0. |
+|
`ApplicationName`
`Application Name`
(case insensitive) | No | | Sets the application name for the connection. |
| `trustServerCertificate` | No | `false` | Configures whether to trust the server certificate. |
| `trustServerCertificateCA` | No | | A path to a certificate authority file to be used instead of the system certificates to authorize the server certificate. Must be either in `pem`, `crt` or `der` format. Cannot be used together with `trustServerCertificate` parameter. |
@@ -108,7 +108,7 @@ See [Supported databases](/orm/reference/supported-databases).
### Prisma Migrate caveats
-Prisma Migrate is supported in [2.13.0](https://github.com/prisma/prisma/releases/tag/2.13.0) and later with the following caveats:
+Prisma Migrate is supported with the following caveats:
#### Database schema names
diff --git a/content/200-orm/050-overview/500-databases/840-cockroachdb.mdx b/content/200-orm/050-overview/500-databases/840-cockroachdb.mdx
index 846f1401d4..ac6408c4bc 100644
--- a/content/200-orm/050-overview/500-databases/840-cockroachdb.mdx
+++ b/content/200-orm/050-overview/500-databases/840-cockroachdb.mdx
@@ -6,18 +6,8 @@ tocDepth: 3
toc: true
---
-
-
This guide discusses the concepts behind using Prisma ORM and CockroachDB, explains the commonalities and differences between CockroachDB and other database providers, and leads you through the process for configuring your application to integrate with CockroachDB.
-
-
-
-
-The CockroachDB connector is generally available in versions `3.14.0` and later. It was first added as a [Preview feature](/orm/reference/preview-features) in version [`3.9.0`](https://github.com/prisma/prisma/releases/tag/3.9.0) with support for Introspection, and Prisma Migrate support was added in [`3.11.0`](https://github.com/prisma/prisma/releases/tag/3.11.0).
-
-
-
## What is CockroachDB?
CockroachDB is a distributed database that is designed for scalability and high availability. Features include:
@@ -110,7 +100,7 @@ The fields passed to the `datasource` block are:
-While `cockroachdb` and `postgresql` connectors are similar, it is mandatory to use the `cockroachdb` connector instead of `postgresql` when connecting to a CockroachDB database from version 5.0.0.
+While `cockroachdb` and `postgresql` connectors are similar, it is mandatory to use the `cockroachdb` connector instead of `postgresql` when connecting to a CockroachDB database.
diff --git a/content/200-orm/050-overview/500-databases/850-planetscale.mdx b/content/200-orm/050-overview/500-databases/850-planetscale.mdx
index 51c8cda807..f6c6c2a795 100644
--- a/content/200-orm/050-overview/500-databases/850-planetscale.mdx
+++ b/content/200-orm/050-overview/500-databases/850-planetscale.mdx
@@ -65,9 +65,7 @@ If you try to push to a production branch, you will get the [error message](/orm
#### 1. Set `relationMode = "prisma"`
-PlanetScale does not use foreign key constraints in its database schema by default. However, Prisma ORM relies on foreign key constraints in the underlying database to enforce referential integrity between models in your Prisma schema.
-
-In Prisma ORM versions 3.1.1 and later, you can [emulate relations in Prisma Client with the `prisma` relation mode](/orm/prisma-schema/data-model/relations/relation-mode#emulate-relations-in-prisma-orm-with-the-prisma-relation-mode), which avoids the need for foreign key constraints in the database.
+PlanetScale does not use foreign key constraints in its database schema by default. However, Prisma ORM relies on foreign key constraints in the underlying database to enforce referential integrity between models in your Prisma schema. You can [emulate relations in Prisma Client with the `prisma` relation mode](/orm/prisma-schema/data-model/relations/relation-mode#emulate-relations-in-prisma-orm-with-the-prisma-relation-mode), which avoids the need for foreign key constraints in the database.
To enable emulation of relations in Prisma Client, set the `relationMode` field to `"prisma"` in the `datasource` block:
@@ -79,13 +77,7 @@ datasource db {
}
```
-
-
-The ability to set the relation mode was introduced as part of the `referentialIntegrity` preview feature in Prisma ORM version 3.1.1, and is generally available in Prisma ORM versions 4.8.0 and later.
The `relationMode` field was renamed in Prisma ORM version 4.5.0, and was previously named `referentialIntegrity`.
-
-
-
-If you use relations in your Prisma schema with the default `"foreignKeys"` option for the `relationMode` field, PlanetScale will error and Prisma ORM output the [P3021 error message](/orm/reference/error-reference#p3021) when it tries to create foreign keys. (In versions before 2.27.0 it will output a raw database error.)
+If you use relations in your Prisma schema with the default `"foreignKeys"` option for the `relationMode` field, PlanetScale will error and Prisma ORM output the [P3021 error message](/orm/reference/error-reference#p3021) when it tries to create foreign keys.
#### 2. Create indexes on foreign keys
@@ -134,7 +126,7 @@ model Comment {
You can then add this change to your schema [using `db push`](#how-to-make-schema-changes-with-db-push).
-In versions 4.7.0 and later, Prisma ORM warns you if you have a relation with no index on the relation scalar field. For more information, see [Index validation](/orm/prisma-schema/data-model/relations/relation-mode#index-validation).
+Prisma ORM will warn you if you have a relation with no index on the relation scalar field. For more information, see [Index validation](/orm/prisma-schema/data-model/relations/relation-mode#index-validation).
diff --git a/content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx b/content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx
index fc97d81577..d2fc1377ee 100644
--- a/content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx
+++ b/content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx
@@ -4,8 +4,6 @@ metaTitle: 'Data sources (Reference)'
metaDescription: 'Data sources enable Prisma to connect to your database. This page explains how to configure data sources in your Prisma schema.'
---
-
-
A data source determines how Prisma ORM connects your database, and is represented by the [`datasource`](/orm/reference/prisma-schema-reference#datasource) block in the Prisma schema. The following data source uses the `postgresql` provider and includes a connection URL:
```prisma
@@ -20,10 +18,6 @@ A Prisma schema can only have _one_ data source. However, you can:
- [Programmatically override a data source `url` when creating your `PrismaClient`](/orm/reference/prisma-client-reference#programmatically-override-a-datasource-url)
- [Specify a different URL for Prisma Migrate's shadow database if you are working with cloud-hosted development databases](/orm/prisma-migrate/understanding-prisma-migrate/shadow-database#cloud-hosted-shadow-databases-must-be-created-manually)
-> **Note**: Multiple provider support was removed in 2.22.0. Please see [Deprecation of provider array notation](https://github.com/prisma/prisma/issues/3834) for more information.
-
-
-
## Securing database connections
Some data source `provider`s allow you to configure your connection with SSL/TLS, and provide parameters for the `url` to specify the location of certificates.
diff --git a/content/200-orm/100-prisma-schema/10-overview/04-location.mdx b/content/200-orm/100-prisma-schema/10-overview/04-location.mdx
index ce40444b4f..0a8dfd2852 100644
--- a/content/200-orm/100-prisma-schema/10-overview/04-location.mdx
+++ b/content/200-orm/100-prisma-schema/10-overview/04-location.mdx
@@ -18,7 +18,7 @@ The Prisma CLI looks for the Prisma Schema in the following locations, in the fo
prisma generate --schema=./alternative/schema.prisma
```
-2. The location specified in the `package.json` file (version 2.7.0 and later):
+2. The location specified in the `package.json` file:
```json
"prisma": {
diff --git a/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx b/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx
index f8b2711c3e..821892e885 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/10-models.mdx
@@ -439,7 +439,7 @@ Refer to the [relations documentation](/orm/prisma-schema/data-model/relations)
### Native types mapping
-Version [2.17.0](https://github.com/prisma/prisma/releases/tag/2.17.0) and later support **native database type attributes** (type attributes) that describe the underlying database type:
+Prisma ORM supports **native database type attributes** (type attributes) that describe the underlying database type:
```prisma highlight=3;normal
model Post {
@@ -795,7 +795,7 @@ model Post {
Default values can be:
- Static values that correspond to the field type, such as `5` (`Int`), `Hello` (`String`), or `false` (`Boolean`)
-- [Lists](/orm/reference/prisma-schema-reference#-modifier) of static values, such as `[5, 6, 8]` (`Int[]`) or `["Hello", "Goodbye"]` (`String`[]). These are available in Prisma ORM versions `4.0.0` and later, when using supported databases (PostgreSQL, CockroachDB and MongoDB)
+- [Lists](/orm/reference/prisma-schema-reference#-modifier) of static values, such as `[5, 6, 8]` (`Int[]`) or `["Hello", "Goodbye"]` (`String`[]). These are available when using supported databases (PostgreSQL, CockroachDB and MongoDB)
- [Functions](#using-functions), such as [`now()`](/orm/reference/prisma-schema-reference#now) or [`uuid()`](/orm/reference/prisma-schema-reference#uuid)
- JSON data. Note that JSON needs to be enclosed with double-quotes inside the `@default` attribute, e.g.: `@default("[]")`. If you want to provide a JSON object, you need to enclose it with double-quotes and then escape any internal double quotes using a backslash, e.g.: `@default("{ \"hello\": \"world\" }")`.
@@ -913,7 +913,7 @@ Refer to the documentation on [working with composite unique identifiers](/orm/p
#### Composite type unique constraints
-When using the MongoDB provider in version `3.12.0` and later, you can define a unique constraint on a field of a [composite type](#defining-composite-types) using the syntax `@@unique([compositeType.field])`. As with other fields, composite type fields can be used as part of a multi-column unique constraint.
+When using the MongoDB provider you can define a unique constraint on a field of a [composite type](#defining-composite-types) using the syntax `@@unique([compositeType.field])`. As with other fields, composite type fields can be used as part of a multi-column unique constraint.
The following example defines a multi-column unique constraint based on the `email` field of the `User` model and the `number` field of the `Address` composite type which is used in `User.address`:
@@ -975,7 +975,7 @@ You can optionally define a [custom index name](/orm/prisma-schema/data-model/da
#### Defining composite type indexes
-When using the MongoDB provider in version `3.12.0` and later, you can define an index on a field of a [composite type](#defining-composite-types) using the syntax `@@index([compositeType.field])`. As with other fields, composite type fields can be used as part of a multi-column index.
+When using the MongoDB provider you can define an index on a field of a [composite type](#defining-composite-types) using the syntax `@@index([compositeType.field])`. As with other fields, composite type fields can be used as part of a multi-column index.
The following example defines a multi-column index based on the `email` field of the `User` model and the `number` field of the `Address` composite type:
@@ -1067,12 +1067,6 @@ enum Role {
## Defining composite types
-
-
-Composite types were added in version `3.10.0` under the `mongodb` Preview feature flag and are in General Availability since version `3.12.0`.
-
-
-
Composite types are currently only available on MongoDB.
diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx
index 577a7a80e8..6b7fe30f42 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx
@@ -95,7 +95,7 @@ model Profile {
-In MySQL, you can create a foreign key with only an index on the referenced side, and not a unique constraint. In Prisma ORM versions 4.0.0 and later, if you introspect a relation of this type it will trigger a validation error. To fix this, you will need to add a `@unique` constraint to the referenced field.
+In MySQL, you can create a foreign key with only an index on the referenced side, and not a unique constraint. If you introspect a relation of this type it will trigger a validation error. To fix this, you will need to add a `@unique` constraint to the referenced field.
@@ -190,8 +190,6 @@ model User {
}
```
-This restriction was introduced in 2.12.0.
-
However, you can choose if the side of the relation _with_ a relation scalar should be optional or mandatory.
### Mandatory 1-1 relation
diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx
index 8a46de8dec..48cff7ae91 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx
@@ -93,7 +93,7 @@ model Post {
-In MySQL, you can create a foreign key with only an index on the referenced side, and not a unique constraint. In Prisma ORM versions 4.0.0 and later, if you introspect a relation of this type it will trigger a validation error. To fix this, you will need to add a `@unique` constraint to the referenced field.
+In MySQL, you can create a foreign key with only an index on the referenced side, and not a unique constraint. If you introspect a relation of this type it will trigger a validation error. To fix this, you will need to add a `@unique` constraint to the referenced field.
diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx
index 2e0d6ccc7f..d635b61a60 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx
@@ -5,21 +5,7 @@ metaDescription: 'Referential actions let you define the update and delete behav
tocDepth: 3
---
-
-
-Referential actions determine what happens to a record when your application deletes or updates a related record.
-
-From version 2.26.0, you can define referential actions on the relation fields in your Prisma schema. This allows you to define referential actions like cascading deletes and cascading updates at a Prisma ORM level.
-
-
-
-**Version differences**
-
-- If you use version 3.0.1 or later, you can use referential actions as described on this page.
-- If you use a version between 2.26.0 and 3.0.0, you can use referential actions as described on this page, but you must [enable the preview feature flag](/orm/reference/preview-features/client-preview-features#enabling-a-prisma-client-preview-feature) `referentialActions`.
-- If you use version 2.25.0 or earlier, you can configure cascading deletes manually in your database.
-
-
+Referential actions determine what happens to a record when your application deletes or updates a related record. You can define referential actions on the relation fields in your Prisma schema. This allows you to define referential actions like cascading deletes and cascading updates at a Prisma ORM level.
In the following example, adding `onDelete: Cascade` to the `author` field on the `Post` model means that deleting the `User` record will also delete all related `Post` records.
@@ -39,15 +25,6 @@ model User {
If you do not specify a referential action, Prisma ORM [uses a default](#referential-action-defaults).
-
-
-
-
-If you upgrade from a version earlier than 2.26.0:
-It is extremely important that you check the [upgrade paths for referential actions](/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/referential-actions) section. Prisma ORM's support of referential actions **removes the safety net in Prisma Client that prevents cascading deletes at runtime**. If you use the feature _without upgrading your database_, the [old default action](/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/referential-actions#prisma-orm-2x-default-referential-actions) - `ON DELETE CASCADE` - becomes active. This might result in cascading deletes that you did not expect.
-
-
-
## What are referential actions?
Referential actions are policies that define how a referenced record is handled by the database when you run an [`update`](/orm/prisma-client/queries/crud#update) or [`delete`](/orm/prisma-client/queries/crud#delete) query.
@@ -160,12 +137,11 @@ The following table shows which referential action each database supports.
| SQLite | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| SQL Server | ✔️ | ❌‡ | ✔️ | ✔️ | ✔️ |
| CockroachDB | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
-| MongoDB†† | ✔️ | ✔️ | ✔️ | ✔️ | ❌ |
+| MongoDB | ✔️ | ✔️ | ✔️ | ✔️ | ❌ |
- † See [special cases for MySQL](#mysqlmariadb).
- ⌘ See [special cases for PostgreSQL](#postgresql).
- ‡ See [special cases for SQL Server](#sql-server).
-- †† Referential actions for MongoDB are available in Prisma ORM versions 3.7.0 and later.
### Special cases for referential actions
@@ -270,7 +246,7 @@ The `NoAction` action is similar to `Restrict`, the difference between the two i
- **MySQL**: `NoAction` behaves exactly the same as `Restrict`. See [the MySQL docs](https://dev.mysql.com/doc/refman/8.0/en/create-table-foreign-keys.html#foreign-key-referential-actions) for more information.
- **SQLite**: When a related primary key is modified or deleted, no action is taken. See [the SQLite docs](https://www.sqlite.org/foreignkeys.html#fk_actions) for more information.
- **SQL Server**: When a referenced record is deleted or modified, an error is raised. See [the SQL Server docs](https://learn.microsoft.com/en-us/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver15#on-delete-referential-actions-on-edge-constraints) for more information.
-- **MongoDB** (in preview from version 3.6.0): When a record is modified or deleted, nothing is done to any related records.
+- **MongoDB**: When a record is modified or deleted, nothing is done to any related records.
@@ -361,158 +337,3 @@ When the `username` of a `User` changes, its existing posts' `authorUsername` fi
### Database-specific requirements
MongoDB and SQL Server have specific requirements for referential actions if you have [self-relations](/orm/prisma-schema/data-model/relations/referential-actions/special-rules-for-referential-actions#self-relation-sql-server-and-mongodb) or [cyclic relations](/orm/prisma-schema/data-model/relations/referential-actions/special-rules-for-referential-actions#cyclic-relation-between-three-tables-sql-server-and-mongodb) in your data model. SQL Server also has specific requirements if you have relations with [multiple cascade paths](/orm/prisma-schema/data-model/relations/referential-actions/special-rules-for-referential-actions#multiple-cascade-paths-between-two-models-sql-server-only).
-
-## Upgrade paths from versions 2.25.0 and earlier
-
-There are a couple of paths you can take when upgrading which will give different results depending on the desired outcome.
-
-If you currently use the migration workflow, you can run an introspection to check how the defaults are reflected in your schema. You can then manually update your database if you need to.
-
-You can also decide to skip checking the defaults and run a migration to update your database with the [new default values](#referential-action-defaults).
-
-The following assumes you have upgraded to 2.26.0 or newer and enabled the preview feature flag, or upgraded to 3.0.0 or newer:
-
-### Using Introspection
-
-If you [Introspect](/orm/prisma-schema/introspection) your database, the referential actions configured at the database level will be reflected in your Prisma Schema. If you have been using Prisma Migrate or `prisma db push` to manage the database schema, these are likely to be the [default values](#referential-action-defaults) from 2.25.0 and earlier.
-
-When you run an Introspection, Prisma ORM compares all the foreign keys in the database with the schema, if the SQL statements `ON DELETE` and `ON UPDATE` do **not** match the default values, they will be explicitly set in the schema file.
-
-After introspecting, you can review the non-default clauses in your schema. The most important clause to review is `onDelete`, which defaults to `Cascade` in 2.25.0 and earlier.
-
-
-
-If you are using either the [`delete()`](/orm/prisma-client/queries/crud#delete-a-single-record) or [`deleteMany()`](/orm/prisma-client/queries/crud#delete-all-records) methods, **[cascading deletes](#how-to-use-cascading-deletes) will now be performed** as the `referentialActions` preview feature **removed the safety net in Prisma Client that previously prevented cascading deletes at runtime**. Be sure to check your code and make any adjustments accordingly.
-
-
-
-Make sure you are happy with every case of `onDelete: Cascade` in your schema. If not, either:
-
-- Modify your Prisma schema and `db push` or `dev migrate` to change the database
-
-_or_
-
-- Manually update the underlying database if you use an introspection-only workflow
-
-The following example would result in a cascading delete, if the `User` is deleted then all of their `Post`'s will be deleted too.
-
-#### A blog schema example
-
-```prisma showLineNumbers
-model Post {
- id Int @id @default(autoincrement())
- title String
- //add-next-line
- author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
- authorId Int
-}
-
-model User {
- id Int @id @default(autoincrement())
- posts Post[]
-}
-```
-
-### Using Migration
-
-When running a [Migration](/orm/prisma-migrate) (or the [`prisma db push`](/orm/prisma-migrate/workflows/prototyping-your-schema) command) the [new defaults](#referential-action-defaults) will be applied to your database.
-
-
-
-Unlike when you run an Introspect for the first time, the new referential actions clause and property, will **not** automatically be added to your prisma schema by the Prisma VSCode extension.
-You will have to manually add them if you wish to use anything other than the new defaults.
-
-
-
-Explicitly defining referential actions in your Prisma schema is optional. If you do not explicitly define a referential action for a relation, Prisma ORM uses the [new defaults](#referential-action-defaults).
-
-Note that referential actions can be added on a case by case basis. This means that you can add them to one single relation and leave the rest set to the defaults by not manually specifying anything.
-
-### Checking for errors
-
-**Before** upgrading to 2.26.0 and enabling the referential actions **preview feature**, Prisma ORM prevented the deletion of records while using `delete()` or `deleteMany()` to preserve referential integrity. A custom runtime error would be thrown by Prisma Client with the error code `P2014`.
-
-**After** upgrading and enabling the referential actions **preview feature**, Prisma ORM no longer performs runtime checks. You can instead specify a custom referential action to preserve the referential integrity between relations.
-
-When you use [`NoAction`](#noaction) or [`Restrict`](#restrict) to prevent the deletion of records, the error messages will be different post 2.26.0 compared to pre 2.26.0. This is because they are now triggered by the database and **not** Prisma Client. The new error code that can be expected is `P2003`.
-
-To make sure you catch these new errors you can adjust your code accordingly.
-
-#### Example of catching errors
-
-The following example uses the below blog schema with a one-to-many relationship between `Post` and `User` and sets a [`Restrict`](#restrict) referential actions on the `author` field.
-
-This means that if a user has a post, that user (and their posts) **cannot** be deleted.
-
-```prisma file=schema.prisma showLineNumbers
-model Post {
- id Int @id @default(autoincrement())
- title String
- author User @relation(fields: [authorId], references: [id], onDelete: Restrict)
- authorId String
-}
-
-model User {
- id Int @id @default(autoincrement())
- posts Post[]
-}
-```
-
-Prior to upgrading and enabling the referential actions **preview feature**, the error code you would receive when trying to delete a user which has posts would be `P2014` and it's message:
-
-> "The change you are trying to make would violate the required relation '\{relation_name}' between the \{model_a_name\} and \{model_b_name\} models."
-
-```ts
-import { PrismaClient } from '@prisma/client'
-
-const prisma = new PrismaClient()
-
-async function main() {
- try {
- await prisma.user.delete({
- where: {
- id: 'some-long-id',
- },
- })
- } catch (error) {
- if (error instanceof Prisma.PrismaClientKnownRequestError) {
- if (error.code === 'P2014') {
- console.log(error.message)
- }
- }
- }
-}
-
-main()
-```
-
-To make sure you are checking for the correct errors in your code, modify your check to look for `P2003`, which will deliver the message:
-
-> "Foreign key constraint failed on the field: \{field_name\}"
-
-```ts highlight=14;delete|15;add
-import { PrismaClient } from '@prisma/client'
-
-const prisma = new PrismaClient()
-
-async function main() {
- try {
- await prisma.user.delete({
- where: {
- id: 'some-long-id'
- }
- })
- } catch (error) {
- if (error instanceof Prisma.PrismaClientKnownRequestError) {
- //delete-next-line
- if (error.code === 'P2014') {
- //add-next-line
- if (error.code === 'P2003') {
- console.log(error.message)
- }
- }
- }
-}
-
-main()
-```
diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx
index a054e7d778..6ab732cc97 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx
@@ -85,12 +85,6 @@ datasource db {
}
```
-
-
-The ability to set the relation mode was introduced as part of the `referentialIntegrity` preview feature in Prisma ORM version 3.1.1, and is generally available in Prisma ORM versions 4.8.0 and later.
The `relationMode` field was renamed in Prisma ORM version 4.5.0, and was previously named `referentialIntegrity`.
-
-
-
For relational databases, the available options are:
- `foreignKeys`: this handles relations in the database with foreign keys. This is the default option for all relational database connectors and is active if no `relationMode` is explicitly set in the `datasource` block.
diff --git a/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx b/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx
index 958ad1c732..20aa325ec4 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/30-indexes.mdx
@@ -5,19 +5,9 @@ hidePage: false
tocDepth: 3
---
-
+Prisma ORM allows configuration of database indexes, unique constraints and primary key constraints.
-Prisma ORM allows configuration of database indexes, unique constraints and primary key constraints. This is in General Availability in versions `4.0.0` and later. You can enable this with the `extendedIndexes` Preview feature in versions `3.5.0` and later.
-
-Version `3.6.0` also introduces support for introspection and migration of full text indexes in MySQL and MongoDB through a new `@@fulltext` attribute, available through the `fullTextIndex` Preview feature.
-
-
-
-If you are upgrading from a version earlier than 4.0.0, these changes to index configuration and full text indexes might be **breaking changes** if you have a database that already uses these features. See [Upgrading from previous versions](#upgrading-from-previous-versions) for more information on how to upgrade.
-
-
-
-
+Prisma ORM has also introduced support for introspection and migration of full text indexes in MySQL and MongoDB through a new `@@fulltext` attribute, available through the `fullTextIndex` Preview feature.
## Index configuration
@@ -48,7 +38,7 @@ See the linked sections for details of which version each feature was first intr
The `length` argument is specific to MySQL and allows you to define indexes and constraints on columns of `String` and `Byte` types. For these types, MySQL requires you to specify a maximum length for the subpart of the value to be indexed in cases where the full value would exceed MySQL's limits for index sizes. See [the MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html) for more details.
-The `length` argument is available on the `@id`, `@@id`, `@unique`, `@@unique` and `@@index` attributes. It is generally available in versions 4.0.0 and later, and available as part of the `extendedIndexes` preview feature in versions 3.5.0 and later.
+The `length` argument is available on the `@id`, `@@id`, `@unique`, `@@unique` and `@@index` attributes.
As an example, the following data model declares an `id` field with a maximum length of 3000 characters:
@@ -95,7 +85,7 @@ A similar syntax can be used for the `@@unique` and `@@index` attributes.
The `sort` argument is available for all databases supported by Prisma ORM. It allows you to specify the order that the entries of the index or constraint are stored in the database. This can have an effect on whether the database is able to use an index for specific queries.
-The `sort` argument is available for all databases on `@unique`, `@@unique` and `@@index`. Additionally, SQL Server also allows it on `@id` and `@@id`. It is generally available in versions 4.0.0 and later, and available as part of the `extendedIndexes` preview feature in versions 3.5.0 and later.
+The `sort` argument is available for all databases on `@unique`, `@@unique` and `@@index`. Additionally, SQL Server also allows it on `@id` and `@@id`.
As an example, the following table
@@ -144,7 +134,7 @@ model Post {
### Configuring the access type of indexes with `type` (PostgreSQL)
-The `type` argument is available for configuring the index type in PostgreSQL with the `@@index` attribute. The index access methods available are `Hash`, `Gist`, `Gin`, `SpGist` and `Brin`, as well as the default `BTree` index access method. The `type` argument is generally available in versions 4.0.0 and later. The `Hash` index access method is available as part of the `extendedIndexes` preview feature in versions 3.6.0 and later, and the `Gist`, `Gin`, `SpGist` and `Brin` index access methods are available in preview in versions 3.14.0 and later.
+The `type` argument is available for configuring the index type in PostgreSQL with the `@@index` attribute. The index access methods available are `Hash`, `Gist`, `Gin`, `SpGist` and `Brin`, as well as the default `BTree` index access method.
#### Hash
@@ -414,7 +404,7 @@ Read more about built-in operator classes in the [official PostgreSQL documentat
### Configuring if indexes are clustered or non-clustered with `clustered` (SQL Server)
-The `clustered` argument is available to configure (non)clustered indexes in SQL Server. It can be used on the `@id`, `@@id`, `@unique`, `@@unique` and `@@index` attributes. It is generally available in versions 4.0.0 and later, and available as part of the `extendedIndexes` preview feature in versions 3.13.0 and later.
+The `clustered` argument is available to configure (non)clustered indexes in SQL Server. It can be used on the `@id`, `@@id`, `@unique`, `@@unique` and `@@index` attributes.
As an example, the following model configures the `@id` to be non-clustered (instead of the clustered default):
@@ -466,13 +456,13 @@ In each of the cases above unwanted changes to your database can be prevented by
## Full text indexes (MySQL and MongoDB)
-The `fullTextIndex` preview feature provides support for introspection and migration of full text indexes in MySQL and MongoDB in version 3.6.0 and later. This can be configured using the `@@fulltext` attribute. Existing full text indexes in the database are added to your Prisma schema after introspecting with `db pull`, and new full text indexes added in the Prisma schema are created in the database when using Prisma Migrate. This also prevents validation errors in some database schemas that were not working before.
+The `fullTextIndex` preview feature provides support for introspection and migration of full text indexes in MySQL and MongoDB. This can be configured using the `@@fulltext` attribute. Existing full text indexes in the database are added to your Prisma schema after introspecting with `db pull`, and new full text indexes added in the Prisma schema are created in the database when using Prisma Migrate. This also prevents validation errors in some database schemas that were not working before.
-
+:::warning
For now we do not enable the full text search commands in Prisma Client for MongoDB; the progress can be followed in the [MongoDB](https://github.com/prisma/prisma/issues/9413) issue.
-
+:::
### Enabling the `fullTextIndex` preview feature
@@ -520,13 +510,3 @@ model Post {
@@fulltext([title(sort: Desc), content])
}
```
-
-### Upgrading from previous versions
-
-
-
-This can be a **breaking change** when activating the functionality for certain, existing Prisma schemas for existing databases. After enabling the preview features required to use them, run `prisma db pull` to introspect the existing database to update your Prisma schema before using Prisma Migrate again.
-
-
-
-Earlier versions of Prisma ORM converted full text indexes using the `@@index` attribute rather than the `@@fulltext` attribute. After enabling the `fullTextIndex` preview feature, run `prisma db pull` to convert these indexes to `@@fulltext` before migrating again with Prisma Migrate. If you do not do this, the existing indexes will be dropped instead and normal indexes will be created in their place.
diff --git a/content/200-orm/100-prisma-schema/20-data-model/40-views.mdx b/content/200-orm/100-prisma-schema/20-data-model/40-views.mdx
index f78802b4ef..f4cfa54db3 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/40-views.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/40-views.mdx
@@ -294,7 +294,7 @@ When re-introspecting your database, any custom changes to your view definitions
#### The `views` directory
-Introspection of a database with one or more existing views will also create a new `views` directory within your `prisma` directory (starting with Prisma version 4.12.0). This directory will contain a subdirectory named after your database's schema which contains a `.sql` file for each view that was introspected in that schema. Each file will be named after an individual view and will contain the query the related view defines.
+Introspection of a database with one or more existing views will also create a new `views` directory within your `prisma` directory. This directory will contain a subdirectory named after your database's schema which contains a `.sql` file for each view that was introspected in that schema. Each file will be named after an individual view and will contain the query the related view defines.
For example, after introspecting a database with the default `public` schema using the model used above you will find a `prisma/views/public/UserInfo.sql` file was created with the following contents:
diff --git a/content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx b/content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx
index 7ace185004..fd21aa713b 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx
@@ -80,16 +80,10 @@ enum Type {
## Constraint and index names
-You can optionally use the `map` argument to explicitly define the **underlying constraint and index names** in the Prisma schema for the attributes [`@id`](/orm/reference/prisma-schema-reference#id), [`@@id`](/orm/reference/prisma-schema-reference#id-1), [`@unique`](/orm/reference/prisma-schema-reference#unique), [`@@unique`](/orm/reference/prisma-schema-reference#unique-1), [`@@index`](/orm/reference/prisma-schema-reference#index) and [`@relation`](/orm/reference/prisma-schema-reference#relation). (This is available in Prisma ORM version [2.29.0](https://github.com/prisma/prisma/releases/tag/2.29.0) and later.)
+You can optionally use the `map` argument to explicitly define the **underlying constraint and index names** in the Prisma schema for the attributes [`@id`](/orm/reference/prisma-schema-reference#id), [`@@id`](/orm/reference/prisma-schema-reference#id-1), [`@unique`](/orm/reference/prisma-schema-reference#unique), [`@@unique`](/orm/reference/prisma-schema-reference#unique-1), [`@@index`](/orm/reference/prisma-schema-reference#index) and [`@relation`](/orm/reference/prisma-schema-reference#relation).
When introspecting a database, the `map` argument will _only_ be rendered in the schema if the name _differs_ from Prisma ORM's [default constraint naming convention for indexes and constraints](#prisma-orms-default-naming-conventions-for-indexes-and-constraints).
-
-
-If you use Prisma Migrate in a version earlier than 2.29.0 and want to maintain your existing constraint and index names after upgrading to a newer version, **do not** immediately run `prisma migrate` or `prisma db push`. This will **change any underlying constraint name that does not follow Prisma ORM's convention**. Follow the [upgrade path that allows you to maintain existing constraint and index names](/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/named-constraints#option-1-i-want-to-maintain-my-existing-constraint-and-index-names).
-
-
-
### Use cases for named constraints
Some use cases for explicitly named constraints include:
diff --git a/content/200-orm/100-prisma-schema/20-data-model/70-unsupported-database-features.mdx b/content/200-orm/100-prisma-schema/20-data-model/70-unsupported-database-features.mdx
index a620d29f68..5c3be56c34 100644
--- a/content/200-orm/100-prisma-schema/20-data-model/70-unsupported-database-features.mdx
+++ b/content/200-orm/100-prisma-schema/20-data-model/70-unsupported-database-features.mdx
@@ -53,24 +53,7 @@ In PostgreSQL, some native database functions are part of an extension. For exam
To use a PostgreSQL extension, you must first install it on the file system of your database server.
-In Prisma ORM versions 4.5.0 and later, you can then activate the extension by declaring it in your Prisma schema with the [`postgresqlExtensions` preview feature](/orm/prisma-schema/postgresql-extensions):
-
-```prisma file=schema.prisma highlight=3,9;add showLineNumbers
-generator client {
- provider = "prisma-client-js"
- //add-next-line
- previewFeatures = ["postgresqlExtensions"]
-}
-
-datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- //add-next-line
- extensions = [pgcrypto]
-}
-```
-
-In earlier versions of Prisma ORM, you must instead run a SQL command to activate the extension:
+You must instead run a SQL command to activate the extension:
```sql
CREATE EXTENSION IF NOT EXISTS pgcrypto;
diff --git a/content/200-orm/100-prisma-schema/50-introspection.mdx b/content/200-orm/100-prisma-schema/50-introspection.mdx
index 0e76630d80..29fd04cadc 100644
--- a/content/200-orm/100-prisma-schema/50-introspection.mdx
+++ b/content/200-orm/100-prisma-schema/50-introspection.mdx
@@ -315,7 +315,7 @@ Note that you can rename the [Prisma-ORM level](/orm/prisma-schema/data-model/re
## Introspection with an existing schema
-Running `prisma db pull` for relational databases with an existing Prisma Schema merges manual changes made to the schema, with changes made in the database. (This functionality has been added for the first time with version 2.6.0.) For MongoDB, Introspection for now is meant to be done only once for the initial data model. Running it repeatedly will lead to loss of custom changes, as the ones listed below.
+Running `prisma db pull` for relational databases with an existing Prisma Schema merges manual changes made to the schema, with changes made in the database. For MongoDB, Introspection is meant to be done only once for the initial data model. Running it repeatedly will lead to loss of custom changes, as the ones listed below.
Introspection for relational databases maintains the following manual changes:
@@ -365,19 +365,15 @@ The Prisma Schema Language (PSL) can express a majority of the database features
For these features, the Prisma CLI will surface detect usage of the feature in your database and return a warning. The Prisma CLI will also add a comment in the models and fields the features are in use in the Prisma schema. The warnings will also contain a workaround suggestion.
The `prisma db pull` command will surface the following unsupported features:
-
-- From version [4.13.0](https://github.com/prisma/prisma/releases/tag/4.13.0):
- [Partitioned tables](https://github.com/prisma/prisma/issues/1708)
- [PostgreSQL Row Level Security](https://github.com/prisma/prisma/issues/12735)
- [Index sort order, `NULLS FIRST` / `NULLS LAST`](https://github.com/prisma/prisma/issues/15466)
- [CockroachDB row-level TTL](https://github.com/prisma/prisma/issues/13982)
- [Comments](https://github.com/prisma/prisma/issues/8703)
- [PostgreSQL deferred constraints](https://github.com/prisma/prisma/issues/8807)
-- From version [4.14.0](https://github.com/prisma/prisma/releases/tag/4.14.0):
- [Check Constraints](https://github.com/prisma/prisma/issues/3388) (MySQL + PostgreSQL)
- [Exclusion Constraints](https://github.com/prisma/prisma/issues/17514)
- [MongoDB $jsonSchema](https://github.com/prisma/prisma/issues/8135)
-- From version [4.16.0](https://github.com/prisma/prisma/releases/tag/4.16.0):
- [Expression indexes](https://github.com/prisma/prisma/issues/2504)
You can find the list of features we intend to support on [GitHub (labeled with `topic:database-functionality`)](https://github.com/prisma/prisma/issues?q=is%3Aopen+label%3A%22topic%3A+database-functionality%22+label%3Ateam%2Fschema+sort%3Aupdated-desc+).
diff --git a/content/200-orm/100-prisma-schema/80-postgresql-extensions.mdx b/content/200-orm/100-prisma-schema/80-postgresql-extensions.mdx
index 56fb3cf0b1..c6cedb0099 100644
--- a/content/200-orm/100-prisma-schema/80-postgresql-extensions.mdx
+++ b/content/200-orm/100-prisma-schema/80-postgresql-extensions.mdx
@@ -8,12 +8,6 @@ tocDepth: 3
This page introduces PostgreSQL extensions and describes how to represent extensions in your Prisma schema, how to introspect existing extensions in your database, and how to apply changes to your extensions to your database with Prisma Migrate.
-
-
-Support for declaring PostgreSQL extensions in your schema is available in preview for the PostgreSQL connector only in Prisma versions 4.5.0 and later.
-
-
-
## What are PostgreSQL extensions?
PostgreSQL allows you to extend your database functionality by installing and activating packages known as _extensions_. For example, the `citext` extension adds a case-insensitive string data type. Some extensions, such as `citext`, are supplied directly by PostgreSQL, while other extensions are developed externally. For more information on extensions, see [the PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-createextension.html).
diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx
index 023aba982d..3ac1f3b1b0 100644
--- a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx
+++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx
@@ -85,11 +85,11 @@ If the above script runs multiple times in the context of a long-running applica
## Exit hooks
-
+:::info
-From Prisma ORM 5.0.0, the `beforeExit` hook only applies to the [binary Query Engine](/orm/more/under-the-hood/engines#configuring-the-query-engine).
+The `beforeExit` hook only applies to the [binary Query Engine](/orm/more/under-the-hood/engines#configuring-the-query-engine).
-
+:::
The `beforeExit` hook runs when Prisma ORM is triggered externally (e.g. via a `SIGINT` signal) to shut down, and allows you to run code _before_ Prisma Client disconnects - for example, to issue queries as part of a graceful shutdown of a service:
diff --git a/content/200-orm/200-prisma-client/100-queries/030-crud.mdx b/content/200-orm/200-prisma-client/100-queries/030-crud.mdx
index 09dba52754..2d6750a321 100644
--- a/content/200-orm/200-prisma-client/100-queries/030-crud.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/030-crud.mdx
@@ -228,9 +228,7 @@ For more information about working with generated types, see: [Generated types](
### Create multiple records
-Prisma Client supports bulk inserts as a GA feature in [2.20.0](https://github.com/prisma/prisma/releases/2.20.0) and later.
-
-The following [`createMany()`](/orm/reference/prisma-client-reference#createmany) query creates multiple users and skips any duplicates (`email` must be unique):
+Prisma Client supports bulk inserts. The following [`createMany()`](/orm/reference/prisma-client-reference#createmany) query creates multiple users and skips any duplicates (`email` must be unique):
@@ -790,7 +788,7 @@ const upsertUser = await prisma.user.upsert({
-From version 4.6.0, Prisma Client carries out upserts with database native SQL commands where possible. [Learn more](/orm/reference/prisma-client-reference#database-upserts).
+Prisma Client carries out upserts with database native SQL commands where possible. [Learn more](/orm/reference/prisma-client-reference#database-upserts).
@@ -867,12 +865,6 @@ Be aware that this query will fail if the user has any related records (such as
### Cascading deletes (deleting related records)
-
-
-In [2.26.0](https://github.com/prisma/prisma/releases/tag/2.26.0) and later it is possible to do cascading deletes using the **preview feature** [referential actions](/orm/prisma-schema/data-model/relations/referential-actions).
-
-
-
The following query uses [`delete()`](/orm/reference/prisma-client-reference#delete) to delete a single `User` record:
```ts
diff --git a/content/200-orm/200-prisma-client/100-queries/035-select-fields.mdx b/content/200-orm/200-prisma-client/100-queries/035-select-fields.mdx
index c6b290300a..cb721d7001 100644
--- a/content/200-orm/200-prisma-client/100-queries/035-select-fields.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/035-select-fields.mdx
@@ -332,4 +332,4 @@ Notice how the returned object does _not_ contain the `password` field.
## Relation count
-In [3.0.1](https://github.com/prisma/prisma/releases/3.0.1) and later, you can `include` or `select` a [count of relations](/orm/prisma-client/queries/aggregation-grouping-summarizing#count-relations) alongside fields. For example, a user's post count.
+You can `include` or `select` a [count of relations](/orm/prisma-client/queries/aggregation-grouping-summarizing#count-relations) alongside fields. For example, a user's post count.
diff --git a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
index b7a14af3ec..d02ae7ca86 100644
--- a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
@@ -381,7 +381,7 @@ const user = await prisma.user.findFirst({
## Relation count
-In [3.0.1](https://github.com/prisma/prisma/releases/3.0.1) and later, you can [`include` or `select` a count of relations](/orm/prisma-client/queries/aggregation-grouping-summarizing#count-relations) alongside fields - for example, a user's post count.
+You can [`include` or `select` a count of relations](/orm/prisma-client/queries/aggregation-grouping-summarizing#count-relations) alongside fields - for example, a user's post count.
diff --git a/content/200-orm/200-prisma-client/100-queries/050-filtering-and-sorting.mdx b/content/200-orm/200-prisma-client/100-queries/050-filtering-and-sorting.mdx
index 813f6605b6..32c6e70ad7 100644
--- a/content/200-orm/200-prisma-client/100-queries/050-filtering-and-sorting.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/050-filtering-and-sorting.mdx
@@ -367,7 +367,7 @@ const posts = await prisma.post.findMany({
### Sort by relation aggregate value
-In [2.19.0](https://github.com/prisma/prisma/releases/2.19.0) and later, you can sort by the **count of related records**.
+You can sort by the **count of related records**.
For example, the following query sorts users by the number of related posts:
@@ -386,7 +386,7 @@ const getActiveUsers = await prisma.user.findMany({
### Sort by relevance (PostgreSQL and MySQL)
-In [3.5.0+](https://github.com/prisma/prisma/releases/3.5.0) for PostgreSQL and [3.8.0+](https://github.com/prisma/prisma/releases/3.8.0) for MySQL, you can sort records by relevance to the query using the `_relevance` keyword. This uses the relevance ranking functions from full text search features.
+You can sort records by relevance to the query using the `_relevance` keyword. This uses the relevance ranking functions from full text search features.
This feature is further explain in [the PostgreSQL documentation](https://www.postgresql.org/docs/12/textsearch-controls.html) and [the MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html).
@@ -431,7 +431,6 @@ Prior to Prisma ORM 5.16.0, enabling the `fullTextSearch` preview feature would
Notes:
-- This feature is generally available in version `4.16.0` and later. To use this feature in versions [`4.1.0`](https://github.com/prisma/prisma/releases/tag/4.1.0) to [`4.15.0`](https://github.com/prisma/prisma/releases/tag/4.15.0) the [Preview feature](/orm/reference/preview-features/client-preview-features#enabling-a-prisma-client-preview-feature) `orderByNulls` will need to be enabled.
- This feature is not available for MongoDB.
- You can only sort by nulls on optional [scalar](/orm/prisma-schema/data-model/models#scalar-fields) fields. If you try to sort by nulls on a required or [relation](/orm/prisma-schema/data-model/models#relation-fields) field, Prisma Client throws a [P2009 error](/orm/reference/error-reference#p2009).
diff --git a/content/200-orm/200-prisma-client/100-queries/056-aggregation-grouping-summarizing.mdx b/content/200-orm/200-prisma-client/100-queries/056-aggregation-grouping-summarizing.mdx
index c0695ef1ab..645346657f 100644
--- a/content/200-orm/200-prisma-client/100-queries/056-aggregation-grouping-summarizing.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/056-aggregation-grouping-summarizing.mdx
@@ -53,7 +53,7 @@ console.log('Average age:' + aggregations._avg.age)
### Aggregate values are nullable
-In [2.21.0](https://github.com/prisma/prisma/releases/tag/2.21.0) and later, aggregations on **nullable fields** can return a `number` or `null`. This excludes `count`, which always returns 0 if no records are found.
+Aggregations on **nullable fields** can return a `number` or `null`. This excludes `count`, which always returns 0 if no records are found.
Consider the following query, where `age` is nullable in the schema:
@@ -97,7 +97,7 @@ This allows you to differentiate between the true aggregate value (which could b
## Group by
-Prisma Client's [`groupBy()`](/orm/reference/prisma-client-reference#groupby) allows you to **group records** by one or more field values - such as `country`, or `country` and `city` and **perform aggregations** on each group, such as finding the average age of people living in a particular city. `groupBy()` is a GA in [2.20.0](https://github.com/prisma/prisma/releases/2.20.0) and later.
+Prisma Client's [`groupBy()`](/orm/reference/prisma-client-reference#groupby) allows you to **group records** by one or more field values - such as `country`, or `country` and `city` and **perform aggregations** on each group, such as finding the average age of people living in a particular city.
The following video uses `groupBy()` to summarize total COVID-19 cases by continent:
@@ -265,13 +265,13 @@ const groupUsers = await prisma.user.groupBy({
The following constraints apply when you combine `groupBy()` and `orderBy`:
-- You can `orderBy` fields that are present in `by`
-- You can `orderBy` aggregate (Preview in 2.21.0 and later)
-- If you use `skip` and/or `take` with `groupBy()`, you must also include `orderBy` in the query
+- You can `orderBy` fields that are present in `by`.
+- You can `orderBy` aggregates.
+- If you use `skip` and/or `take` with `groupBy()`, you must also include `orderBy` in the query.
#### Order by aggregate group
-You can **order by aggregate group**. Prisma ORM added support for using `orderBy` with aggregated groups in relational databases in version [2.21.0](https://github.com/prisma/prisma/releases/2.21.0) and support for MongoDB in [3.4.0](https://github.com/prisma/prisma/releases/3.4.0).
+You can **order by aggregate group**.
The following example sorts each `city` group by the number of users in that group (largest group first):
@@ -350,12 +350,6 @@ const userCount = await prisma.user.count()
### Count relations
-
-
-This feature is generally available in version [3.0.1](https://github.com/prisma/prisma/releases/3.0.1) and later. To use this feature in versions before 3.0.1 the [Preview feature](/orm/reference/preview-features/client-preview-features#enabling-a-prisma-client-preview-feature) `selectRelationCount` will need to be enabled.
-
-
-
To return a count of relations (for example, a user's post count), use the `_count` parameter with a nested `select` as shown:
@@ -390,7 +384,7 @@ The `_count` parameter:
- Can be used inside a top-level `include` _or_ `select`
- Can be used with any query that returns records (including `delete`, `update`, and `findFirst`)
- Can return [multiple relation counts](#return-multiple-relation-counts)
-- Can [filter relation counts](#filter-the-relation-count) (from version 4.3.0)
+- Can [filter relation counts](#filter-the-relation-count)
#### Return a relations count with `include`
@@ -491,12 +485,6 @@ const usersWithCount = await prisma.user.findMany({
#### Filter the relation count
-
-
-This feature is generally available in version `4.16.0` and later. To use this feature in versions [`4.3.0`](https://github.com/prisma/prisma/releases/tag/4.3.0) to [`4.15.0`](https://github.com/prisma/prisma/releases/tag/4.15.0) the [Preview feature](/orm/reference/preview-features/client-preview-features#enabling-a-prisma-client-preview-feature) `filteredRelationCount` will need to be enabled.
-
-
-
Use `where` to filter the fields returned by the `_count` output type. You can do this on [scalar fields](/orm/prisma-schema/data-model/models#scalar-fields), [relation fields](/orm/prisma-schema/data-model/models#relation-fields) and fields of a [composite type](/orm/prisma-schema/data-model/models#defining-composite-types).
For example, the following query returns all user posts with the title "Hello!":
@@ -534,7 +522,7 @@ await prisma.user.findMany({
### Count non-`null` field values
-In [2.15.0](https://github.com/prisma/prisma/releases/2.15.0) and later, you can count all records as well as all instances of non-`null` field values. The following query returns a count of:
+You can count all records as well as all instances of non-`null` field values. The following query returns a count of:
- All `User` records (`_all`)
- All non-`null` `name` values (not distinct values, just values that are not `null`)
diff --git a/content/200-orm/200-prisma-client/100-queries/058-transactions.mdx b/content/200-orm/200-prisma-client/100-queries/058-transactions.mdx
index 63b93505b5..f9009ce132 100644
--- a/content/200-orm/200-prisma-client/100-queries/058-transactions.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/058-transactions.mdx
@@ -13,12 +13,6 @@ A database transaction refers to a sequence of read/write operations that are _g
## Transactions overview
-
-
-Before Prisma ORM version 4.4.0, you could not set isolation levels on transactions. The isolation level in your database configuration always applied.
-
-
-
Developers take advantage of the safety guarantees provided by the database by wrapping the operations in a transaction. These guarantees are often summarized using the ACID acronym:
- **Atomic**: Ensures that either _all_ or _none_ operations of the transactions succeed. The transaction is either _committed_ successfully or _aborted_ and _rolled back_.
@@ -175,7 +169,7 @@ Instead of immediately awaiting the result of each operation when it's performed
>
> Refer to the section about the [transactions API](#transaction-api) for more examples.
-From version 4.4.0, the sequential operations transaction API has a second parameter. You can use the following optional configuration option in this parameter:
+You can use the following optional configuration option in this parameter:
- `isolationLevel`: Sets the [transaction isolation level](#transaction-isolation-level). By default this is set to the value currently configured in your database.
@@ -199,14 +193,6 @@ await prisma.$transaction(
Sometimes you need more control over what queries execute within a transaction. Interactive transactions are meant to provide you with an escape hatch.
-
-
-Interactive transactions have been generally available from version 4.7.0.
-
-If you use interactive transactions in preview from version 2.29.0 to 4.6.1 (inclusive), you need to add the `interactiveTransactions` preview feature to the generator block of your Prisma schema.
-
-
-
To use interactive transactions, you can pass an async function into [`$transaction`](#transaction-api).
The first argument passed into this async function is an instance of Prisma Client. Below, we will call this instance `tx`. Any Prisma Client call invoked on this `tx` instance is encapsulated into the transaction.
@@ -344,14 +330,6 @@ This feature is not available on MongoDB, because MongoDB does not support isola
You can set the transaction [isolation level](https://www.prisma.io/dataguide/intro/database-glossary#isolation-levels) for transactions.
-
-
-This is available in the following Prisma ORM versions for interactive transactions from version 4.2.0, for sequential operations from version 4.4.0.
-
-In versions before 4.2.0 (for interactive transactions), or 4.4.0 (for sequential operations), you cannot configure the transaction isolation level at a Prisma ORM level. Prisma ORM does not explicitly set the isolation level, so the [isolation level configured in your database](#database-specific-information-on-isolation-levels) is used.
-
-
-
#### Set the isolation level
To set the transaction isolation level, use the `isolationLevel` option in the second parameter of the API.
@@ -1170,13 +1148,11 @@ If a ❌ conflict occurs (someone else has changed the record since you read it)
This section describes how to build your own optimistic concurrency control. See also: Plans for [application-level optimistic concurrency control on GitHub](https://github.com/prisma/prisma/issues/4988)
-
-
-- If you use version 4.4.0 or earlier, you cannot use optimistic concurrency control on `update` operations, because you cannot filter on non-unique fields. The `version` field you need to use with optimistic concurrency control is a non-unique field.
+:::info
-- Since version 5.0.0 you are able to [filter on non-unique fields in `update` operations](/orm/reference/prisma-client-reference#filter-on-non-unique-fields-with-userwhereuniqueinput) so that optimistic concurrency control is being used. The feature was also available via the Preview flag `extendedWhereUnique` from versions 4.5.0 to 4.16.2.
+- Since Prisma ORM version 5.0.0 you are able to [filter on non-unique fields in `update` operations](/orm/reference/prisma-client-reference#filter-on-non-unique-fields-with-userwhereuniqueinput) so that optimistic concurrency control is being used.
-
+:::
#### When to use optimistic concurrency control
diff --git a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx
index ef473c95b8..e2f7ba9a06 100644
--- a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx
@@ -5,7 +5,7 @@ metaDescription: 'This page explains how to search for text within a field.'
sidebar_class_name: preview-badge
---
-Prisma Client supports full-text search for **PostgreSQL** databases in versions 2.30.0 and later, and **MySQL** databases in versions 3.8.0 and later. With full-text search (FTS) enabled, you can add search functionality to your application by searching for text within a database column.
+Prisma Client supports full-text search for **PostgreSQL** and **MySQL** database. With full-text search (FTS) enabled, you can add search functionality to your application by searching for text within a database column.
:::info
diff --git a/content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx b/content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx
index c1e69e2dcd..31b8115e31 100644
--- a/content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx
+++ b/content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx
@@ -99,80 +99,6 @@ model Post {
The computed fields are type-safe and can return anything from a concatenated value to complex objects or functions that can act as an instance method for your models.
-
-
-Instructions prior to Prisma ORM 4.16.0
-
-:::warning
-
-With Prisma Client extensions Generally Available as of Prisma ORM version 4.16.0, the following steps are not recommended. Please use [a client extension](#using-a-prisma-client-extension) to accomplish this.
-
-:::
-
-Prisma Client does not yet natively support computed fields, but, you can define a function that accepts a generic type as an input then extend that generic to ensure it conforms to a specific structure. Finally, you can return that generic with additional computed fields. Let's see how that might look:
-
-
-
-
-
-```tsx
-// Define a type that needs a first and last name
-type FirstLastName = {
- firstName: string
- lastName: string
-}
-
-// Extend the T generic with the fullName attribute
-type WithFullName = T & {
- fullName: string
-}
-
-// Take objects that satisfy FirstLastName and computes a full name
-function computeFullName(
- user: User
-): WithFullName {
- return {
- ...user,
- fullName: user.firstName + ' ' + user.lastName,
- }
-}
-
-async function main() {
- const user = await prisma.user.findUnique({ where: 1 })
- const userWithFullName = computeFullName(user)
-}
-```
-
-
-
-
-
-```js
-function computeFullName(user) {
- return {
- ...user,
- fullName: user.firstName + ' ' + user.lastName,
- }
-}
-
-async function main() {
- const user = await prisma.user.findUnique({ where: 1 })
- const userWithFullName = computeFullName(user)
-}
-```
-
-
-
-
-
-In the TypeScript example above, a `User` generic has been defined that extends the `FirstLastName` type. This means that whatever you pass into `computeFullName` must contain `firstName` and `lastName` keys.
-
-A `WithFullName` return type has also been defined, which takes whatever `User` is and tacks on a `fullName` string attribute.
-
-With this function, any object that contains `firstName` and `lastName` keys can compute a `fullName`. Pretty neat, right?
-
-
-
### Going further
- Learn how you can use [Prisma Client extensions](/orm/prisma-client/client-extensions) to add a computed field to your schema — [example](https://github.com/prisma/prisma-client-extensions/tree/main/computed-fields).
diff --git a/content/200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx b/content/200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx
index e0ff6126d1..8f7506bffc 100644
--- a/content/200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx
+++ b/content/200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx
@@ -17,7 +17,7 @@ Prisma Client supports the option of sending raw queries to your database. You m
- you want to run a heavily optimized query
- you require a feature that Prisma Client does not yet support (please [consider raising an issue](https://github.com/prisma/prisma/issues/new/choose))
-Raw queries are available for all relational databases Prisma ORM supports. In addition, from version `3.9.0` raw queries are supported in MongoDB. For more details, see the relevant sections:
+Raw queries are available for all databases Prisma ORM supports.
- [Raw queries with relational databases](#raw-queries-with-relational-databases)
- [Raw queries with MongoDB](#raw-queries-with-mongodb)
@@ -333,15 +333,6 @@ $executeRawUnsafe(query: string, ...values: any[]): PrismaPromise
-
-**Feature availability:**
-
-- In v3.14.x and v3.15.x, raw query type mapping was available with the preview feature `improvedQueryRaw`. We made raw query type mapping [Generally Available](/orm/more/releases#generally-available-ga) in version 4.0.0, so you do not need to use `improvedQueryRaw` in version 4.0.0 or later.
-- Before version 4.0.0, raw query type mapping was not available for SQLite.
-
-
-
As an example, take a raw query that selects columns with `BigInt`, `Bytes`, `Decimal` and `Date` types from a table:
@@ -412,26 +403,9 @@ The solution in this case is to explicitly cast `42` to the `text` type:
await prisma.$queryRaw`SELECT LENGTH(${42}::text);`;
```
-:::info
-
-**Feature availability:** This funtionality is [Generally Available](/orm/more/releases#generally-available-ga) since version 4.0.0. In v3.14.x and v3.15.x, it was available with the preview feature `improvedQueryRaw`.
-
-For the example above before version 4.0.0, Prisma ORM silently coerces `42` to `text` and does not require the explicit cast.
-
-On the other hand the following raw query now works correctly, returning an integer result, and failed before:
-
-```ts
-await prisma.$queryRaw`SELECT ${1.5}::int as int`;
-
-// Now: [{ int: 2 }]
-// Before: db error: ERROR: incorrect binary data format in bind parameter 1
-```
-
-:::
-
### Transactions
-In 2.10.0 and later, you can use `.$executeRaw()` and `.$queryRaw()` inside a [transaction](/orm/prisma-client/queries/transactions).
+You can use `.$executeRaw()` and `.$queryRaw()` inside a [transaction](/orm/prisma-client/queries/transactions).
### Using variables
@@ -743,7 +717,7 @@ const result = await prisma.$queryRawUnsafe(
## Raw queries with MongoDB
-For MongoDB in versions `3.9.0` and later, Prisma Client exposes three methods that allow you to send raw queries. You can use:
+For MongoDB, Prisma Client exposes three methods that allow you to send raw queries. You can use:
- `$runCommandRaw` to run a command against the database
- `.findRaw` to find zero or more documents that match the filter.
diff --git a/content/200-orm/200-prisma-client/150-using-raw-sql/index.mdx b/content/200-orm/200-prisma-client/150-using-raw-sql/index.mdx
index b598c28e4c..1b102dccce 100644
--- a/content/200-orm/200-prisma-client/150-using-raw-sql/index.mdx
+++ b/content/200-orm/200-prisma-client/150-using-raw-sql/index.mdx
@@ -66,6 +66,6 @@ For MongoDB, Prisma ORM supports three methods to execute raw queries:
These methods allow you to execute raw MongoDB commands and queries, providing flexibility when you need to use MongoDB-specific features or optimizations.
-`$runCommandRaw` is used to execute database commands, `.findRaw` is used to find documents that match a filter, and `.aggregateRaw` is used for aggregation operations. All three methods are available from Prisma version 3.9.0 and later.
+`$runCommandRaw` is used to execute database commands, `.findRaw` is used to find documents that match a filter, and `.aggregateRaw` is used for aggregation operations.
Similar to raw queries in relational databases, these methods are not type-safe and require manual handling of the query results.
\ No newline at end of file
diff --git a/content/200-orm/200-prisma-client/200-special-fields-and-types/057-composite-types.mdx b/content/200-orm/200-prisma-client/200-special-fields-and-types/057-composite-types.mdx
index fb67569058..47fee42e38 100644
--- a/content/200-orm/200-prisma-client/200-special-fields-and-types/057-composite-types.mdx
+++ b/content/200-orm/200-prisma-client/200-special-fields-and-types/057-composite-types.mdx
@@ -15,8 +15,6 @@ Composite types are only available with MongoDB.
[Composite types](/orm/prisma-schema/data-model/models#defining-composite-types), known as [embedded documents](https://www.mongodb.com/docs/manual/data-modeling/#embedded-data) in MongoDB, allow you to embed records within other records.
-We made composite types [Generally Available](/orm/more/releases#generally-available-ga) in v3.12.0. They were previously available in [Preview](/orm/reference/preview-features) from v3.10.0.
-
This page explains how to:
- [find](#finding-records-that-contain-composite-types-with-find-and-findmany) records that contain composite types using `findFirst` and `findMany`
@@ -97,7 +95,7 @@ There are currently some limitations when using composite types in Prisma Client
## Default values for required fields on composite types
-From version 4.0.0, if you carry out a database read on a composite type when all of the following conditions are true, then Prisma Client inserts the default value into the result.
+If you carry out a database read on a composite type when all of the following conditions are true, then Prisma Client inserts the default value into the result.
Conditions:
@@ -131,15 +129,6 @@ console.dir(await prisma.product.findMany({}), { depth: Infinity })
The `bitDepth` field has no content because you have only just added this field, so the query returns the default value of `8`.
-** Earlier versions **
-
-Before version 4.0.0, Prisma ORM threw a P2032 error as follows:
-
-```
-Error converting field "bitDepth" of expected non-nullable
-type "int", found incompatible value of "null".
-```
-
## Finding records that contain composite types with `find` and `findMany`
Records can be filtered by a composite type within the `where` operation.
diff --git a/content/200-orm/200-prisma-client/200-special-fields-and-types/100-working-with-json-fields.mdx b/content/200-orm/200-prisma-client/200-special-fields-and-types/100-working-with-json-fields.mdx
index c8591a7f59..faed63123f 100644
--- a/content/200-orm/200-prisma-client/200-special-fields-and-types/100-working-with-json-fields.mdx
+++ b/content/200-orm/200-prisma-client/200-special-fields-and-types/100-working-with-json-fields.mdx
@@ -144,21 +144,11 @@ const getUsers = await prisma.user.findMany({
You can also filter rows by the data inside a `Json` field. We call this **advanced `Json` filtering**. This functionality is supported by [PostgreSQL](/orm/overview/databases/postgresql) and [MySQL](/orm/overview/databases/mysql) only with [different syntaxes for the `path` option](#path-syntax-depending-on-database).
-
+:::warning
PostgreSQL does not support [filtering on object key values in arrays](#filtering-on-object-key-value-inside-array).
-
-
-
-
-The availability of advanced `Json` filtering depends on your Prisma version:
-
-- v4.0.0 or later: advanced `Json` filtering is [generally available](/orm/more/releases#generally-available-ga).
-- From v2.23.0, but before v4.0.0: advanced `Json` filtering is a [preview feature](/orm/reference/preview-features/client-preview-features). Add `previewFeatures = ["filterJson"]` to your schema. [Learn more](/orm/reference/preview-features/client-preview-features#enabling-a-prisma-client-preview-feature).
-- Before v2.23.0: you can [filter on the exact `Json` field value](#filter-on-exact-field-value), but you cannot use the other features described in this section.
-
-
+:::
### `path` syntax depending on database
@@ -890,12 +880,6 @@ To differentiate between these possibilities, we've introduced three _null enums
-From v4.0.0, `JsonNull`, `DbNull`, and `AnyNull` are objects. Before v4.0.0, they were strings.
-
-
-
-
-
- When filtering using any of the _null enums_ you can not use a shorthand and leave the `equals` operator off.
- These _null enums_ do not apply to MongoDB because there the difference between a JSON `null` and a database `NULL` does not exist.
- The _null enums_ do not apply to the `array_contains` operator in all databases because there can only be a JSON `null` within a JSON array. Since there cannot be a database `NULL` within a JSON array, `{ array_contains: null }` is not ambiguous.
diff --git a/content/200-orm/200-prisma-client/200-special-fields-and-types/200-working-with-scalar-lists-arrays.mdx b/content/200-orm/200-prisma-client/200-special-fields-and-types/200-working-with-scalar-lists-arrays.mdx
index 6682d03c9d..978aa45116 100644
--- a/content/200-orm/200-prisma-client/200-special-fields-and-types/200-working-with-scalar-lists-arrays.mdx
+++ b/content/200-orm/200-prisma-client/200-special-fields-and-types/200-working-with-scalar-lists-arrays.mdx
@@ -59,13 +59,6 @@ const createdUser = await prisma.user.create({
## Unsetting the value of a scalar list
-
-
-This method is available on MongoDB only in versions
-[3.11.1](https://github.com/prisma/prisma/releases/tag/3.11.1) and later.
-
-
-
The following example demonstrates how to [`unset`](/orm/reference/prisma-client-reference#unset) the value of a scalar list (`coinflips`):
```ts
@@ -83,15 +76,11 @@ Unlike `set: null`, `unset` removes the list entirely.
## Adding items to a scalar list
-
-
-Available for:
+:::warning
-- PostgreSQL in versions [2.15.0](https://github.com/prisma/prisma/releases/tag/2.15.0) and later
-- CockroachDB in versions [3.9.0](https://github.com/prisma/prisma/releases/tag/3.9.0) and later
-- MongoDB in versions [3.11.0](https://github.com/prisma/prisma/releases/tag/3.11.0) and later
+Available for: PostgreSQL, CockroachDB, and MongoDB.
-
+:::
Use the [`push`](/orm/reference/prisma-client-reference#push) method to add a single value to a scalar list:
@@ -139,11 +128,7 @@ if (user) {
-Available for:
-
-- PostgreSQL in versions [2.15.0](https://github.com/prisma/prisma/releases/tag/2.15.0) and later
-- CockroachDB in versions [3.9.0](https://github.com/prisma/prisma/releases/tag/3.9.0) and later
-- MongoDB in versions [3.11.0](https://github.com/prisma/prisma/releases/tag/3.11.0) and later
+Available for PostgreSQL, CockroachDB, and MongoDB.
@@ -163,10 +148,7 @@ const posts = await prisma.post.findMany({
-This section applies to:
-
-- PostgreSQL in versions [2.15.0](https://github.com/prisma/prisma/releases/tag/2.15.0) and later
-- CockroachDB in versions [3.9.0](https://github.com/prisma/prisma/releases/tag/3.9.0) and later
+This information applies to PostgreSQL and CockroachDB.
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/100-model.mdx b/content/200-orm/200-prisma-client/300-client-extensions/100-model.mdx
index f245f1ba7e..f7e0c71364 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/100-model.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/100-model.mdx
@@ -5,14 +5,6 @@ metaDescription: 'Extend the functionality of Prisma Client, model component'
toc_max_heading_level: 4
---
-
-
-
-
-Prisma Client extensions are Generally Available from versions 4.16.0 and later. They were introduced in Preview in version 4.7.0. Make sure you enable the `clientExtensions` Preview feature flag if you are running on a version earlier than 4.16.0.
-
-
-
You can use the `model` [Prisma Client extensions](/orm/prisma-client/client-extensions) component type to add custom methods to your models.
Possible uses for the `model` component include the following:
@@ -22,8 +14,6 @@ Possible uses for the `model` component include the following:
- Repetitive operations
- Model-specific utilities
-
-
## Add a custom method
Use the `$extends` [client-level method](/orm/reference/prisma-client-reference#client-methods) to create an _extended client_. An extended client is a variant of the standard Prisma Client that is wrapped by one or more extensions. Use the `model` extension component to add methods to models in your schema.
@@ -134,12 +124,6 @@ const prisma = new PrismaClient().$extends({
## Get the current model name at runtime
-
-
-This feature is available from version 4.9.0.
-
-
-
You can get the name of the current model at runtime with `Prisma.getExtensionContext(this).$name`. You might use this to write out the model name to a log, to send the name to another service, or to branch your code based on the model.
For example:
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx b/content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx
index 5aad99108e..0955104a33 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx
@@ -5,18 +5,8 @@ metaDescription: 'Extend the functionality of Prisma Client, client component'
toc_max_heading_level: 4
---
-
-
-
-
-Prisma Client extensions are Generally Available from versions 4.16.0 and later. They were introduced in Preview in version 4.7.0. Make sure you enable the `clientExtensions` Preview feature flag if you are running on a version earlier than 4.16.0.
-
-
-
You can use the `client` [Prisma Client extensions](/orm/prisma-client/client-extensions) component to add top-level methods to Prisma Client.
-
-
## Extend Prisma Client
Use the `$extends` [client-level method](/orm/reference/prisma-client-reference#client-methods) to create an _extended client_. An extended client is a variant of the standard Prisma Client that is wrapped by one or more extensions. Use the `client` extension component to add top-level methods to Prisma Client.
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/120-query.mdx b/content/200-orm/200-prisma-client/300-client-extensions/120-query.mdx
index 733c03041b..3e6c7b69a4 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/120-query.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/120-query.mdx
@@ -5,20 +5,10 @@ metaDescription: 'Extend the functionality of Prisma Client, query component'
toc_max_heading_level: 4
---
-
-
-
-
-Prisma Client extensions are Generally Available from versions 4.16.0 and later. They were introduced in Preview in version 4.7.0. Make sure you enable the `clientExtensions` Preview feature flag if you are running on a version earlier than 4.16.0.
-
-
-
You can use the `query` [Prisma Client extensions](/orm/prisma-client/client-extensions) component type to hook into the query life-cycle and modify an incoming query or its result.
You can use Prisma Client extensions `query` component to create independent clients. This provides an alternative to [middlewares](/orm/prisma-client/client-extensions/middleware). You can bind one client to a specific filter or user, and another client to another filter or user. For example, you might do this to get [user isolation](/orm/prisma-client/client-extensions#extended-clients) in a row-level security (RLS) extension. In addition, unlike middlewares the `query` extension component gives you end-to-end type safety. [Learn more about `query` extensions versus middlewares](#query-extensions-versus-middlewares).
-
-
## Extend Prisma Client query operations
Use the `$extends` [client-level method](/orm/reference/prisma-client-reference#client-methods) to create an [extended client](/orm/prisma-client/client-extensions#about-prisma-client-extensions). An extended client is a variant of the standard Prisma Client that is wrapped by one or more extensions.
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx b/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx
index a413790ec3..c0a5b98f51 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/130-result.mdx
@@ -5,18 +5,8 @@ metaDescription: 'Extend the functionality of Prisma Client, result component'
toc_max_heading_level: 4
---
-
-
-
-
-Prisma Client extensions are Generally Available from versions 4.16.0 and later. They were introduced in Preview in version 4.7.0. Make sure you enable the `clientExtensions` Preview feature flag if you are running on a version earlier than 4.16.0.
-
-
-
You can use the `result` [Prisma Client extensions](/orm/prisma-client/client-extensions) component type to add custom fields and methods to query results.
-
-
Use the `$extends` [client-level method](/orm/reference/prisma-client-reference#client-methods) to create an _extended client_. An extended client is a variant of the standard Prisma Client that is wrapped by one or more extensions.
To add a custom [field](#add-a-custom-field-to-query-results) or [method](#add-a-custom-method-to-the-result-object) to query results, use the following structure. In this example, we add the custom field `myComputedField` to the result of a `user` model query.
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/140-shared-extensions.mdx b/content/200-orm/200-prisma-client/300-client-extensions/140-shared-extensions.mdx
index 88922a36dc..6ee74b07ea 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/140-shared-extensions.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/140-shared-extensions.mdx
@@ -80,21 +80,6 @@ Refer to the following pages to learn the different ways you can modify Prisma C
- [Modify a specific operation in all models of your schema](/orm/prisma-client/client-extensions/query#modify-a-specific-operation-in-all-models-of-your-schema)
- [Modify all operations in all models of your schema](/orm/prisma-client/client-extensions/query#modify-all-operations-in-all-models-of-your-schema)
-
- For versions earlier than 4.16.0
-
-The `Prisma` import is available from a different path shown in the snippet below:
-
-```ts
-import { Prisma } from '@prisma/client/scripts/default-index'
-
-export default Prisma.defineExtension({
- name: 'prisma-extension-',
-})
-```
-
-
-
### Publishing the shareable extension to npm
You can then share the extension on `npm`. When you choose a package name, we recommend that you use the `prisma-extension-` convention, to make it easier to find and install.
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/index.mdx b/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/index.mdx
index 35fd2675e1..a94a35e5a4 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/index.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/index.mdx
@@ -4,17 +4,15 @@ metaTitle: 'Middleware (Reference)'
metaDescription: 'Prisma Client middleware allows you to perform actions before or after any query on any model with the prisma.$use method.'
---
-
+:::warning Deprecation warning
-
-
-**Deprecated**: Middleware is deprecated in version 4.16.0.
+Middleware was deprecated in Prisma ORM version 4.16.0.
-We recommend using the [Prisma Client extensions `query` component type](/orm/prisma-client/client-extensions/query) as an alternative to middleware. Prisma Client extensions were first introduced into Preview in version 4.7.0 and made Generally Available in 4.16.0.
+We recommend using the [Prisma Client extensions `query` component type](/orm/prisma-client/client-extensions/query) as an alternative to middleware.
Prisma Client extensions allow you to create independent Prisma Client instances and bind each client to a specific filter or user. For example, you could bind clients to specific users to provide user isolation. Prisma Client extensions also provide end-to-end type safety.
-
+:::
Middlewares act as query-level lifecycle hooks, which allow you to perform an action before or after a query runs. Use the [`prisma.$use`](/orm/reference/prisma-client-reference#use) method to add middleware, as follows:
@@ -61,8 +59,6 @@ Possible use cases for middleware include:
There are many more use cases for middleware - this list serves as inspiration for the types of problems that middleware is designed to address.
-
-
## Samples
The following sample scenarios show how to use middleware in practice:
diff --git a/content/200-orm/200-prisma-client/300-client-extensions/index.mdx b/content/200-orm/200-prisma-client/300-client-extensions/index.mdx
index cfcf31b5e2..bf90015336 100644
--- a/content/200-orm/200-prisma-client/300-client-extensions/index.mdx
+++ b/content/200-orm/200-prisma-client/300-client-extensions/index.mdx
@@ -5,14 +5,6 @@ metaDescription: 'Extend the functionality of Prisma Client'
toc_max_heading_level: 4
---
-
-
-
-
-Prisma Client extensions are Generally Available from versions 4.16.0 and later. They were introduced in Preview in version 4.7.0. Make sure you enable the `clientExtensions` Preview feature flag if you are running on a version earlier than 4.16.0.
-
-
-
You can use Prisma Client extensions to add functionality to your models, result objects, and queries, or to add client-level methods.
You can create an extension with one or more of the following component types:
@@ -24,8 +16,6 @@ You can create an extension with one or more of the following component types:
For example, you might create an extension that uses the `model` and `client` component types.
-
-
## About Prisma Client extensions
When you use a Prisma Client extension, you create an _extended client_. An extended client is a lightweight variant of the standard Prisma Client that is wrapped by one or more extensions. The standard client is not mutated. You can add as many extended clients as you want to your project. [Learn more about extended clients](#extended-clients).
diff --git a/content/200-orm/200-prisma-client/400-type-safety/index.mdx b/content/200-orm/200-prisma-client/400-type-safety/index.mdx
index caa214ec6e..9fa1ceacb1 100644
--- a/content/200-orm/200-prisma-client/400-type-safety/index.mdx
+++ b/content/200-orm/200-prisma-client/400-type-safety/index.mdx
@@ -233,12 +233,6 @@ We recommend using the "safe" `Input` types whenever possible.
## Type utilities
-
-
-This feature is available from Prisma ORM version 4.9.0 upwards.
-
-
-
To help you create highly type-safe applications, Prisma Client provides a set of type utilities that tap into input and output types. These types are fully dynamic, which means that they adapt to any given model and schema. You can use them to improve the auto-completion and developer experience of your projects.
This is especially useful in [validating inputs](/orm/prisma-client/type-safety/prisma-validator) and [shared Prisma Client extensions](/orm/prisma-client/client-extensions/shared-extensions).
diff --git a/content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx b/content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx
index 27db92374b..87d8be0888 100644
--- a/content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx
+++ b/content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx
@@ -57,8 +57,6 @@ To use Prisma Client metrics, you must do the following:
### 1. Install up-to-date Prisma ORM dependencies
-Use version `3.15.0` or higher of the `prisma` and `@prisma/client` npm packages.
-
```terminal
npm install prisma@latest --save-dev
npm install @prisma/client@latest --save
diff --git a/content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx b/content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx
index fb1a954c10..457c166092 100644
--- a/content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx
+++ b/content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx
@@ -80,7 +80,7 @@ This section explains how to install and register tracing in your application.
### Step 1. Install up-to-date Prisma ORM dependencies
-Use version `6.1.0` or later of the `prisma`, `@prisma/client`, and `@prisma/instrumentation` npm packages. You will also need to install the `@opentelemetry/api` package as it's a peer dependency.
+Use the latest versions of the `prisma`, `@prisma/client`, and `@prisma/instrumentation` npm packages. You will also need to install the `@opentelemetry/api` package as it's a peer dependency.
```terminal
npm install prisma@latest --save-dev
@@ -92,7 +92,7 @@ npm install @opentelemetry/api@latest --save
Tracing on previous versions of Prisma ORM
-Tracing was added in version `4.2.0` of Prisma ORM as a Preview feature. For versions of Prisma ORM between `4.2.0` and `6.1.0`, you need to enable the `tracing` Preview feature in your Prisma schema file.
+For versions before Prisma ORM 6.1.0, you will also need to enable the `tracing` Preview feature in your Prisma schema file.
```prisma
generator client {
diff --git a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/300-limitations-and-known-issues.mdx b/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/300-limitations-and-known-issues.mdx
index 49be07a481..be2d76cc27 100644
--- a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/300-limitations-and-known-issues.mdx
+++ b/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/300-limitations-and-known-issues.mdx
@@ -18,7 +18,7 @@ Prisma Migrate does not currently support the MongoDB connector.
Prisma Migrate generates SQL files that are specific to your provider. This means that you cannot use the same migration files for PostgreSQL in production and SQLite in development, because the syntax in the migrations will be incompatible.
-In [2.15.0](https://github.com/prisma/prisma/releases/2.15.0) and later, Prisma Migrate detects when the migrations do not match the configured provider and prints a helpful error message. For example, if your migrations are for a PostgreSQL database but you are using a `provider` is set to `mysql`:
+Prisma Migrate detects when the migrations do not match the configured provider and prints a helpful error message. For example, if your migrations are for a PostgreSQL database but you are using a `provider` is set to `mysql`:
```
Error: P3014
diff --git a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/600-legacy-migrate.mdx b/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/600-legacy-migrate.mdx
deleted file mode 100644
index 272a15e8ad..0000000000
--- a/content/200-orm/300-prisma-migrate/200-understanding-prisma-migrate/600-legacy-migrate.mdx
+++ /dev/null
@@ -1,466 +0,0 @@
----
-title: 'Legacy Prisma Migrate'
-metaTitle: 'Legacy Prisma Migrate (Reference)'
-metaDescription: 'Legacy Prisma Migrate is a declarative data modeling and schema migration tool that is available via the Prisma CLI.'
-tocDepth: 3
-unlisted: true
----
-
-
-
-> **Important!** This page documents legacy Prisma Migrate (Experimental) available in version 2.12.0 and earlier. [Prisma Migrate](/orm/prisma-migrate) is available in version [2.13.0](https://github.com/prisma/prisma/releases/tag/2.13.0) and Generally Available in [2.19.0](https://github.com/prisma/prisma/releases/tag/2.19.0).
-
-Legacy Prisma Migrate is a tool that lets you _change your database schema_, e.g. by creating new tables or adding columns to existing tables. These changes are called _schema migrations_. legacy Prisma Migrate is available as part of the [Prisma CLI](/orm/tools/prisma-cli#installation) via the `legacy Prisma Migrate` command.
-
-
-
-## Documentation
-
-### Legacy Prisma Migrate vs the `db push` command
-
-If you want to prototype or iterate on a schema design in a development environment, consider the [`db push` command](/orm/reference/prisma-cli-reference#db-push).
-
-### Legacy Prisma Migrate vs SQL migrations
-
-Legacy Prisma Migrate is a _declarative_ migration system, as opposed to SQL which can be considered _imperative_:
-
-- **SQL (imperative)**: Provide the individual _steps_ to get from the current schema to the desired schema.
-- **legacy Prisma Migrate (declarative)**: Define the desired schema as a [Prisma schema data model](/orm/prisma-schema/data-model/models) (legacy Prisma Migrate takes care of generating the necessary _steps_).
-
-Here's a quick comparison. Assume you have the following scenario:
-
-1. You need to create the `User` table to store user information (name, email, ...)
-1. Create two new tables `Post` and `Profile` with foreign keys to `User`
-1. Add a new column with a default value to the `Post` table
-
-#### SQL
-
-In SQL, you'd have to send three subsequent SQL statements to account for this scenario:
-
-##### 1. Create the `User` table to store user information (name, email, ...)
-
-```sql
-CREATE TABLE "User" (
- id SERIAL PRIMARY KEY,
- name VARCHAR(255),
- email VARCHAR(255) NOT NULL
-);
-```
-
-##### 2. Create two new tables `Post` and `Profile` with foreign keys to `User`
-
-```sql
-CREATE TABLE "Profile" (
- id SERIAL PRIMARY KEY,
- bio TEXT NOT NULL,
- "user" integer NOT NULL UNIQUE,
- FOREIGN KEY ("user") REFERENCES "User"(id)
-);
-CREATE TABLE "Post" (
- id SERIAL PRIMARY KEY,
- title VARCHAR(255) NOT NULL,
- author integer NOT NULL,
- FOREIGN KEY (author) REFERENCES "User"(id)
-);
-```
-
-##### 3. Add a new column with a default value to the `Post` table
-
-```sql
-ALTER TABLE "Post"
-ADD COLUMN published BOOLEAN DEFAULT false;
-```
-
-#### legacy Prisma Migrate
-
-With legacy Prisma Migrate, you write the desired database schema in the form of a [Prisma schema data model](/orm/prisma-schema/data-model/models) inside your [Prisma schema file](/orm/prisma-schema). To map the data model to your database schema, you then have to run these two commands:
-
-```terminal
-prisma migrate save --experimental
-prisma migrate up --experimental
-```
-
-The first command _saves_ a new migration to the `prisma/migrations` directory in the file system of your project and updates the `_Migration` table in your database. Each time you run this command to save a new migration, it creates a dedicated directory inside of `prisma/migrations` for that specific migration, which will have its own `README.md` file containing detailed information about the migration (e.g. the generated SQL statements which will be executed when you run `legacy Prisma Migrate up`).
-
-The second command _executes_ the migration against your database.
-
-##### 1. Create the `User` table to store user information (name, email, ...)
-
-Add the model to your Prisma schema:
-
-```prisma
-model User {
- id Int @id @default(autoincrement())
- name String?
- email String @unique
-}
-```
-
-Now run the two commands mentioned above:
-
-```terminal
-prisma migrate save --experimental
-prisma migrate up --experimental
-```
-
-##### 2. Create two new tables `Post` and `Profile` with foreign keys to `User`
-
-Add two models with [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) to your Prisma schema:
-
-```prisma
-model User {
- id Int @id @default(autoincrement())
- name String?
- email String @unique
- posts Post[]
- profile Profile?
-}
-
-model Profile {
- id Int @id @default(autoincrement())
- bio String
- user User @relation(fields: [userId], references: [id])
- userId Int
-}
-
-model Post {
- id Int @id @default(autoincrement())
- title String
- author User @relation(fields: [authorId], references: [id])
- authorId Int
-}
-```
-
-Notice that in addition to the [annotated relation fields](/orm/prisma-schema/data-model/relations#annotated-relation-fields) and its relation scalar field (which represent the foreign keys), you must also specify the Prisma-level [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) on the other side of the relation.
-
-Now run the two commands mentioned above:
-
-```terminal
-prisma migrate save --experimental
-prisma migrate up --experimental
-```
-
-##### 3. Add a new column with default value to the `Post` table
-
-Add a [field](/orm/prisma-schema/data-model/models#defining-fields) to the `Post` model:
-
-```prisma
-model User {
- id Int @id @default(autoincrement())
- name String?
- email String @unique
- posts Post[]
- profile Profile?
-}
-
-model Profile {
- id Int @id @default(autoincrement())
- bio String
- user User @relation(fields: [userId], references: [id])
- userId Int
-}
-
-model Post {
- id Int @id @default(autoincrement())
- title String
- published Boolean @default(false)
- authorId Int
- author User @relation(fields: [authorId], references: [id])
-}
-```
-
-Now run the two commands mentioned above:
-
-```terminal
-prisma migrate save --experimental
-prisma migrate up --experimental
-```
-
-### Supported operations
-
-The following table shows which SQL operations are currently supported by legacy Prisma Migrate.
-
-| Operation | SQL | Supported |
-| :-------------------------------- | :------------------------------ | :-----------------------------------------------------------------------------------: |
-| Create a new table | `CREATE TABLE` | ✔️ |
-| Rename an existing table | `ALTER TABLE` + `RENAME` | No |
-| Delete an existing table | `DROP TABLE` | ✔️ |
-| Add a column to an existing table | `ALTER TABLE` + `ADD COLUMN` | ✔️ |
-| Rename an existing column | `ALTER TABLE` + `RENAME COLUMN` | No |
-| Delete an existing column | `ALTER TABLE` + `DROP COLUMN` | ✔️ |
-| Set primary keys (IDs) | `PRIMARY KEY` | ✔️ |
-| Define relations (foreign keys) | `FOREIGN KEY` + `REFERENCES` | ✔️ |
-| Make columns optional/required | `NOT NULL` | ✔️ |
-| Set unique constraints | `UNIQUE` | ✔️ |
-| Set default values | `DEFAULT` | ✔️ |
-| Define enums | `ENUM` | ✔️ |
-| Create indexes | `CREATE INDEX` | ✔️ |
-| Cascading deletes | `ON DELETE` | No (workaround: manually add in SQL and introspect) |
-| Cascading updates | `ON UPDATE` | No |
-| Data validation | `CHECK` | No ([workaround](/orm/more/help-and-troubleshooting/check-constraints)) |
-
-Note that this table assumes that the operation is also supported by the underlying database. For example, `ENUM` is not supported in SQLite. This means that you also can't use `enum` when using legacy Prisma Migrate.
-
-### Migration history
-
-legacy Prisma Migrate stores the migration history of your project in two places:
-
-- A directory called `migrations` on your file system
-- A table called `_Migration` in your database
-
-#### The `migrations` directory
-
-The `migrations` directory stores information about the migrations that have been or will be executed against your database. You should never make any manual changes to the files in `migrations`. The only way to change the content of this directory should be using the `legacy Prisma Migrate save` command.
-
-The `migrations` directory should be checked into version control (e.g. Git).
-
-#### The `_Migration` table
-
-The `_Migration` table additionally stores information about each migration that was ever executed against the database by legacy Prisma Migrate.
-
-### Typical workflow
-
-With **legacy Prisma Migrate**, the workflow looks slightly different:
-
-1. Manually adjust your [Prisma schema data model](/orm/prisma-schema/data-model/models)
-1. Migrate your database using the `legacy Prisma Migrate` CLI commands
-1. (Re-)generate Prisma Client
-1. Use Prisma Client in your application code to access your database
-
-### Troubleshooting
-
-Since legacy Prisma Migrate is currently Experimental, you might end up in a state where the `migrations` directory and/or the `_Migrations` table are out of sync with the actual state of the database. In these cases, it often helps to "reset" legacy Prisma Migrate by deleting the `migrations` folder and deleting all entries from the `_Migration` table.
-
-#### Delete the `migrations` directory
-
-```terminal
-rm -rf migrations
-```
-
-#### Delete all entries from the `_Migration` table
-
-```sql
-TRUNCATE _Migration;
-```
-
-## CLI Reference
-
-> Warning: The `migrate` command is still considered Experimental. As such, there are no guarantees about API stability or production-readiness. Access to this command is provided for evaluation and experimentation. To access Experimental commands, you must add the `--experimental` flag.
-
-The `migrate` command creates and manages database migrations. It can be used to create, apply, and rollback database schema updates in a controlled manner.
-
-The `migrate` command includes a number of subcommands to specify the desired action.
-
-### `migrate save`
-
-Saves a migration that defines the steps necessary to update your current schema.
-
-#### Prerequisites
-
-Before using the `migrate save` command, you must define a valid [`datasource`](/orm/prisma-schema/overview/data-sources) within your `schema.prisma` file.
-
-For example, the following `datasource` defines a SQLite database file within the current directory:
-
-```prisma
-datasource db {
- provider = "sqlite"
- url = "file:my-database.db"
-}
-```
-
-#### Options
-
-The `migrate save` command recognizes the following options to modify its behavior:
-
-| Option | Required | Description | Default |
-| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
-| `--experimental` | Yes | Enables use of Experimental commands. | |
-| `-n`, `--name` | No | The name of the migration. If not provided, `migrate save` will prompt you for a name. | Timestamp `20200618145356` |
-| `-c`, `--create-db` | No | Create the database if it does not exist. | |
-| `-p`, `--preview` | No | Preview the migration that would be created without writing any changes to the filesystem. | |
-| `--schema` | No | Specifies the path to the desired `schema.prisma` file to be processed instead of the default path. Both absolute and relative paths are supported. | `./schema.prisma`, `./prisma/schema.prisma` |
-
-#### Generated Assets
-
-The `migrate save` command generates the following directories and files as necessary:
-
-- `migrations`: A directory within the current project to store migrations. This directory will be created if it does not exist.
-- `migrations/migrate.lock`: A lock file created specifying the current migration applied to the database. This file will be created if it does not exist.
-- `migrations/`: A directory for a specific migration. The migration name is derived from the timestamp when it was created followed by a hyphen and the migration name provided by the user.
-- `migrations//README.md`: A human-readable description of the migration including metadata like when the migration was created and by who, a list of the actual migration changes and a diff of the changes that are made to the `schema.prisma` file.
-- `migrations//schema.prisma`: The schema that will be created if the migration is applied to the project.
-- `migrations//steps.json`: An [alternative representation](https://github.com/prisma/specs/tree/master/migrate#step) of the migration steps that will be applied.
-
-#### Examples
-
-##### Create a new migration
-
-```terminal
-prisma migrate save --experimental
-```
-
-The command will prompt you for a name for the migration since one was not provided on the command line. After creating the migration, the contents of the generated `schema.prisma` file are displayed.
-
-##### Create a migration with a specific name
-
-```terminal
-prisma migrate save --name "First migration" --experimental
-```
-
-##### Create the database if it does not already exist
-
-```terminal
-prisma migrate save --create-db --experimental
-```
-
-##### Preview the migration that would be created by running the `migrate save` command
-
-```terminal
-prisma migrate save --preview --experimental
-```
-
-### `migrate up`
-
-Migrate the database up to a specific state.
-
-#### Prerequisites
-
-Before using the `migrate up` command, you must define a valid [`datasource`](/orm/prisma-schema/overview/data-sources) within your `schema.prisma` file.
-
-For example, the following `datasource` defines a SQLite database file within the current directory:
-
-```prisma
-datasource db {
- provider = "sqlite"
- url = "file:my-database.db"
-}
-```
-
-#### Arguments
-
-The point to migrate the database up to can be defined in any of the following three ways:
-
-| Argument | Required | Description | Default |
-| --------- | -------- | ---------------------------------------------------------------------------------- | ------- |
-| increment | No | Specifies the number of forward migrations to apply. | latest |
-| name | No | Specifies where to migrate to using the name of the final migration to apply. | latest |
-| timestamp | No | Specifies where to migrate to using the timestamp of the final migration to apply. | latest |
-
-#### Options
-
-Additionally, the following options modify the behavior of the `migrate up` command:
-
-| Option | Required | Description | Default |
-| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
-| `--experimental` | Yes | Enables use of Experimental commands | |
-| `-c`, `--create-db` | No | Create the database if it does not exist. | |
-| `-p`, `--preview` | No | Preview the migration that would be created without writing any changes to the filesystem. | |
-| `--schema` | No | Specifies the path to the desired `schema.prisma` file to be processed instead of the default path. Both absolute and relative paths are supported. | `./schema.prisma`, `./prisma/schema.prisma` |
-| `--auto-approve` | No | Skip interactive approval before migrating. | |
-
-#### Examples
-
-##### Migrate the database up to the latest available migration
-
-```terminal
-prisma migrate up --experimental
-```
-
-##### Apply the next two migrations to the database
-
-```terminal
-prisma migrate up 2 --experimental
-```
-
-##### Apply all migrations necessary up to and including a migration by name
-
-```terminal
-prisma migrate up "First migration" --experimental
-```
-
-##### Apply all migrations necessary up to and including a migration by timestamp
-
-```terminal
-prisma migrate up 20200223181448 --experimental
-```
-
-##### Create the database if it does not already exist before applying the migrations
-
-```terminal
-prisma migrate up --create-db --experimental
-```
-
-##### Preview the migration that would be applied by running the `migrate up` command
-
-```terminal
-prisma migrate up --preview --experimental
-```
-
-### `migrate down`
-
-Migrate the database down to a specific state.
-
-#### Prerequisites
-
-Before using the `migrate down` command, you must define a valid [`datasource`](/orm/prisma-schema/overview/data-sources) within your `schema.prisma` file.
-
-For example, the following `datasource` defines a SQLite database file within the current directory:
-
-```prisma
-datasource db {
- provider = "sqlite"
- url = "file:my-database.db"
-}
-```
-
-#### Arguments
-
-The point to migrate back to can be defined in any of the following three ways:
-
-| Argument | Required | Description | Default |
-| --------- | -------- | --------------------------------------------------------------------------------------- | ------- |
-| decrement | No | Specifies the number of backwards migrations to apply. | 1 |
-| name | No | Specifies where to migrate back to using the name of the final migration to apply. |
-| timestamp | No | Specifies where to migrate back to using the timestamp of the final migration to apply. |
-
-#### Options
-
-Additionally, the following options modify the behavior of the `migrate down` command:
-
-| Option | Required | Description | Default |
-| ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
-| `--experimental` | Yes | Enables use of Experimental commands | |
-| `-p`, `--preview` | No | Preview the migration that would be created without writing any changes to the filesystem. | |
-| `--schema` | No | Specifies the path to the desired `schema.prisma` file to be processed instead of the default path. Both absolute and relative paths are supported. | `./schema.prisma`, `./prisma/schema.prisma` |
-
-#### Examples
-
-##### Migrate the database backwards by a single migration
-
-```terminal
-prisma migrate down --experimental
-```
-
-##### Migrate the database backwards by two migrations
-
-```terminal
-prisma migrate down 2 --experimental
-```
-
-##### Migrate backwards through all migrations up to and including a migration by name
-
-```terminal
-prisma migrate down "First migration" --experimental
-```
-
-##### Migrate backwards through all migrations up to and including a migration by timestamp
-
-```terminal
-prisma migrate down 20200223181448 --experimental
-```
-
-##### Preview the migration that would be applied by running the `migrate down` command
-
-```terminal
-prisma migrate down --preview --experimental
-```
diff --git a/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx b/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx
index 55092c5559..d352045f51 100644
--- a/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx
+++ b/content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx
@@ -385,8 +385,6 @@ psql file.sql
### User-defined arguments
-> This feature is available from version 4.15.0 and later.
-
`prisma db seed` allows you to define custom arguments in your seed file that you can pass to the `prisma db seed` command. For example, you could define your own arguments to seed different data for different environments or partially seeding data in some tables.
Here is an example seed file that defines a custom argument to seed different data in different environments:
diff --git a/content/200-orm/300-prisma-migrate/300-workflows/120-native-database-functions.mdx b/content/200-orm/300-prisma-migrate/300-workflows/120-native-database-functions.mdx
index f9a6f18728..98ae838786 100644
--- a/content/200-orm/300-prisma-migrate/300-workflows/120-native-database-functions.mdx
+++ b/content/200-orm/300-prisma-migrate/300-workflows/120-native-database-functions.mdx
@@ -4,44 +4,23 @@ metaTitle: Native database functions
metaDescription: How to enable PostgreSQL native database functions for projects that use Prisma Migrate.
---
-
-
In PostgreSQL, some [native database functions](/orm/prisma-schema/data-model/unsupported-database-features#native-database-functions) are part of optional extensions. For example, in PostgreSQL versions 12.13 and earlier the `gen_random_uuid()` function is part of the [`pgcrypto`](https://www.postgresql.org/docs/10/pgcrypto.html) extension.
To use a PostgreSQL extension, you must install it on the file system of your database server and then activate the extension. If you use Prisma Migrate, this must be done as part of a migration.
-
+:::warning
Do not activate extensions outside a migration file if you use Prisma Migrate. The [shadow database](/orm/prisma-migrate/understanding-prisma-migrate/shadow-database) requires the same extensions. Prisma Migrate creates and deletes the shadow database automatically, so the only way to activate an extension is to include it in a migration file.
-
-
-In Prisma ORM versions 4.5.0 and later, you can activate the extension by declaring it in your Prisma schema with the [`postgresqlExtensions` preview feature](/orm/prisma-schema/postgresql-extensions):
-
-```prisma file=schema.prisma highlight=3,9;add showLineNumbers
-generator client {
- provider = "prisma-client-js"
- //add-next-line
- previewFeatures = ["postgresqlExtensions"]
-}
+:::
-datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- //add-next-line
- extensions = [pgcrypto]
-}
-```
+You can activate the extension by adding a SQL command to your migration file. See [How to install a PostgreSQL extension as part of a migration](#how-to-install-a-postgresql-extension-as-part-of-a-migration).
You can then apply these changes to your database with Prisma Migrate. See [How to migrate PostgreSQL extensions](/orm/prisma-schema/postgresql-extensions#how-to-migrate-postgresql-extensions) for details.
-In earlier versions of Prisma ORM, you must instead add a SQL command to your migration file to activate the extension. See [How to install a PostgreSQL extension as part of a migration](#how-to-install-a-postgresql-extension-as-part-of-a-migration).
-
-
-
## How to install a PostgreSQL extension as part of a migration
-This section describes how to add a SQL command to a migration file to activate a PostgreSQL extension. If you manage PostgreSQL extensions in your Prisma Schema with the `postgresqlExtensions` preview feature instead, see [How to migrate PostgreSQL extensions](/orm/prisma-schema/postgresql-extensions#how-to-migrate-postgresql-extensions).
+This section describes how to add a SQL command to a migration file to activate a PostgreSQL extension.
The following example demonstrates how to install the `pgcrypto` extension as part of a migration:
diff --git a/content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx b/content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx
index 5f20a17429..509c924948 100644
--- a/content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx
+++ b/content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx
@@ -23,12 +23,6 @@ This guide applies to generating SQL down migrations for relational databases on
-
-
-The `migrate diff` and `db execute` commands are available in Preview in versions `3.9.0` and later, and are generally available in versions `3.13.0` and later.
-
-
-
## Considerations when generating down migrations
When generating a down migration file, there are some considerations to be aware of:
diff --git a/content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx b/content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx
index 9f8a5addad..b849aaaf0c 100644
--- a/content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx
+++ b/content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx
@@ -128,8 +128,6 @@ To help with fixing a failed migration, Prisma ORM provides the following comman
- [`prisma migrate diff`](/orm/reference/prisma-cli-reference#migrate-diff) which diffs two database schema sources to create a migration taking one to the state of the second. You can output either a summary of the difference or a sql script. The script can be output into a file via `> file_name.sql` or be piped to the `db execute --stdin` command.
- [`prisma db execute`](/orm/reference/prisma-cli-reference#db-execute) which applies a SQL script to the database without interacting with the Prisma migrations table.
-These commands are available in Preview in versions `3.9.0` and later (with the `--preview-feature` CLI flag), and generally available in versions `3.13.0` and later.
-
This section gives an example scenario of a failed migration, and explains how to use `migrate diff` and `db execute` to fix it.
### Example of a failed migration
@@ -252,12 +250,6 @@ Your local migration history now yields the same result as the state your produc
## Migration history conflicts
-
-
-This does not apply from version [3.12.0](https://github.com/prisma/prisma/releases/tag/3.12.0) upwards.
-
-
-
`prisma migrate deploy` issues a warning if an already applied migration has been edited - however, it does not stop the migration process. To remove the warnings, restore the original migration from source control.
## Prisma Migrate and PgBouncer
diff --git a/content/200-orm/400-tools/05-prisma-cli.mdx b/content/200-orm/400-tools/05-prisma-cli.mdx
index f1af30fe00..5991be70ec 100644
--- a/content/200-orm/400-tools/05-prisma-cli.mdx
+++ b/content/200-orm/400-tools/05-prisma-cli.mdx
@@ -193,7 +193,7 @@ All `prisma` CLI commands return the following codes when they exit:
- exit code 0 when a command runs successfully
- exit code 1 when a command errors
-- exit code 130 when the CLI receives a signal interrupt (SIGINT) message or if the user cancels a prompt. This exit code is available in Prisma ORM versions 4.3.0 and later.
+- exit code 130 when the CLI receives a signal interrupt (SIGINT) message or if the user cancels a prompt.
## Telemetry
diff --git a/content/200-orm/500-reference/050-prisma-client-reference.mdx b/content/200-orm/500-reference/050-prisma-client-reference.mdx
index ca62e82ef3..52d23c8ffd 100644
--- a/content/200-orm/500-reference/050-prisma-client-reference.mdx
+++ b/content/200-orm/500-reference/050-prisma-client-reference.mdx
@@ -407,66 +407,6 @@ const adapter = new PrismaNeon(pool);
const prisma = new PrismaClient({ adapter });
```
-### `rejectOnNotFound`
-
-
-
-**Note**: `rejectOnNotFound` was removed in v5.0.0.
-
-**Deprecated:** `rejectOnNotFound` is deprecated in v4.0.0. From v4.0.0, use the queries [`findUniqueOrThrow`](#finduniqueorthrow) or [`findFirstOrThrow`](#findfirstorthrow).
-
-
-
-Use the `rejectOnNotFound` parameter to configure `findUnique()` and/or `findFirst` to throw an error if the record was not found. By default, both operations return `null` if the record is not found.
-
-#### Remarks
-
-- You can configure `rejectOnNotFound` on a per-request level for both [`findUnique()`](#findunique) and [`findFirst`](#findfirst)
-
-#### Options
-
-| Option | Description |
-| -------------------- | ------------------------------------------------------------------------------------------- |
-| `RejectOnNotFound` | Enable globally (`true` / `false`) _or_ throw a custom error. |
-| `RejectPerOperation` | Enable per operation (`true` / `false`) _or_ throw a custom error per operation, per model. |
-
-#### Examples
-
-##### Enable globally for `findUnique()` and `findFirst`
-
-```ts
-const prisma = new PrismaClient({
- rejectOnNotFound: true,
-});
-```
-
-##### Enable globally for a specific operation
-
-```ts
-const prisma = new PrismaClient({
- rejectOnNotFound: {
- findUnique: true,
- },
-});
-```
-
-##### Throw a custom error per model and operation if record is not found
-
-```ts
-const prisma = new PrismaClient({
- rejectOnNotFound: {
- findFirst: {
- User: (err) => new Error('User error'),
- Post: (err) => new Error('Post error!'),
- },
- findUnique: {
- User: (err) => new Error('User error'),
- Post: (err) => new Error('Post error!'),
- },
- },
-});
-```
-
### `transactionOptions`
@@ -527,7 +467,7 @@ Use model queries to perform CRUD operations on your models. See also: [CRUD](/o
| Name | Example type (`User`) | Required | Description |
| ------------------------------- | ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). Before version 4.5.0, this type only wraps _unique_ fields of a model. |
+| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). |
| `select` | `XOR` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| `include` | `XOR` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| `omit` | `XOR` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0 |
@@ -899,7 +839,7 @@ prisma:query COMMIT
| Name | Type | Required | Description |
| ----------------------- | ------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | `XOR`UserUncheckedUpdateInput>` | **Yes** | Wraps all the fields of the model so that they can be provided when updating an existing record. Fields that are marked as optional or have default values in the datamodel are optional. |
-| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). Before version 4.5.0, this type only wraps _unique_ fields of a model. |
+| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). |
| [`select`](#select) | `XOR` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| [`include`](#include) | `XOR` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| [`omit`](#omit) | `XOR` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0. |
@@ -948,7 +888,7 @@ This section covers the usage of the `upsert()` operation. To learn about using
| ----------------------- | ------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create` | `XOR`UserUncheckedCreateInput>` | **Yes** | Wraps all the fields of the model so that they can be provided when creating new records. It also includes relation fields which lets you perform (transactional) nested inserts. Fields that are marked as optional or have default values in the datamodel are optional. |
| `update` | `XOR`UserUncheckedUpdateInput>` | **Yes** | Wraps all the fields of the model so that they can be provided when updating an existing record. Fields that are marked as optional or have default values in the datamodel are optional. |
-| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). Before version 4.5.0, this type only wraps _unique_ fields of a model. |
+| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). |
| [`select`](#select) | `XOR` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| [`include`](#include) | `XOR` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| [`omit`](#omit) | `XOR` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0 |
@@ -965,7 +905,7 @@ This section covers the usage of the `upsert()` operation. To learn about using
- To perform arithmetic operations on update (add, subtract, multiply, divide), use [atomic updates](#atomic-number-operations) to prevent race conditions.
- If two or more upsert operations happen at the same time and the record doesn't already exist, then a race condition might happen. As a result, one or more of the upsert operations might throw a unique key constraint error. Your application code can catch this error and retry the operation. [Learn more](#unique-key-constraint-errors-on-upserts).
-- From version 4.6.0, Prisma ORM hands over upsert queries to the database where possible. [Learn more](#database-upserts).
+- Prisma ORM hands over upsert queries to the database where possible. [Learn more](#database-upserts).
#### Examples
@@ -1002,24 +942,13 @@ Handle the P2002 error in your application code. When it occurs, retry the upser
Where possible, Prisma Client hands over an `upsert` query to the database. This is called a _database upsert_.
+Prisma Client can use database upserts if your application uses a CockroachDB, PostgreSQL, or SQLite data source.
+
Database upserts have the following advantages:
- They are faster than upserts handled by Prisma Client
- [Unique key constraint errors](#unique-key-constraint-errors-on-upserts) cannot happen
-Prisma Client uses a database upsert automatically when [specific criteria](#database-upsert-query-criteria) are met. When these criteria are not met, Prisma Client handles the `upsert`.
-
-To use a database upsert, Prisma Client sends the SQL construction [`INSERT ... ON CONFLICT SET .. WHERE`](https://www.prisma.io/dataguide/postgresql/inserting-and-modifying-data/insert-on-conflict) to the database.
-
-##### Database upsert prerequisites
-
-Prisma Client can use database upserts if your stack meets the following criteria:
-
-- You use Prisma ORM version 4.6.0 or later
-- Your application uses a CockroachDB, PostgreSQL, or SQLite data source
-
-##### Database upsert query criteria
-
Prisma Client uses a database upsert for an `upsert` query when the query meets the following criteria:
- There are no nested queries in the `upsert`'s `create` and `update` [options](#options-7)
@@ -1030,6 +959,8 @@ Prisma Client uses a database upsert for an `upsert` query when the query meets
If your query does not meet these criteria, then Prisma Client handles the upsert itself.
+To use a database upsert, Prisma Client sends the SQL construction [`INSERT ... ON CONFLICT SET .. WHERE`](https://www.prisma.io/dataguide/postgresql/inserting-and-modifying-data/insert-on-conflict) to the database.
+
##### Database upsert examples
The following examples use this schema:
@@ -1154,7 +1085,7 @@ To delete records that match a certain criteria, use [`deleteMany`](#deletemany)
| Name | Type | Required | Description |
| ----------------------- | ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). Before version 4.5.0, this type only wraps _unique_ fields of a model. |
+| `where` | `UserWhereUniqueInput` | **Yes** | Wraps all fields of a model so that a record can be selected ([learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput)). |
| [`select`](#select) | `XOR` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| [`include`](#include) | `XOR` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| [`omit`](#omit) | `XOR` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0 |
@@ -1743,7 +1674,7 @@ See: [Using Raw SQL (`aggregateRaw()`)](/orm/prisma-client/using-raw-sql/raw-que
#### Remarks
- You cannot combine `select` and `include` on the same level.
-- In [3.0.1](https://github.com/prisma/prisma/releases/3.0.1) and later, you can [select a `_count` of relations](#select-a-_count-of-relations).
+- You can [select a `_count` of relations](#select-a-_count-of-relations).
#### Examples
@@ -1961,7 +1892,7 @@ const selectNameEmailNotPosts = Prisma.validator()({
#### Remarks
-- In [3.0.1](https://github.com/prisma/prisma/releases/3.0.1) and later, you can [`include` a `_count` of relations](#include-a-_count-of-relations)
+- You can [`include` a `_count` of relations](#include-a-_count-of-relations)
#### Examples
@@ -2236,10 +2167,11 @@ The following examples demonstrate how to use the [`validator`](/orm/prisma-clie
});
```
-- `UserWhereUniqueInput` This type works by exposing any unique fields on the model. A field assigned `@id` is considered unique,
- as is one assigned `@unique`.
+- `UserWhereUniqueInput`
- From version 4.5.0, this type exposes all fields on the model. This means that when you filter for a single record based on a unique field, you can check additional non-unique and unique fields at the same time. [Learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput).
+ A field assigned `@id` is considered unique, as is one assigned `@unique`.
+
+ This type exposes all fields on the model. This means that when you filter for a single record based on a unique field, you can check additional non-unique and unique fields at the same time. [Learn more](#filter-on-non-unique-fields-with-userwhereuniqueinput).
```ts
// UserWhereUniqueInput
@@ -2256,8 +2188,9 @@ The following examples demonstrate how to use the [`validator`](/orm/prisma-clie
});
```
-- `PostUpdateWithWhereUniqueWithoutAuthorInput` - This type accepts a unique `where` field (an `@id` or another assigned `@unique`)
- and updates any field on the `Post` model except the `Author`. The `Author` is the scalar field on the `Post` model.
+- `PostUpdateWithWhereUniqueWithoutAuthorInput`
+
+ This type accepts a unique `where` field (an `@id` or another assigned `@unique`) and updates any field on the `Post` model except the `Author`. The `Author` is the scalar field on the `Post` model.
```ts
const updatePostByIdWithoutAuthor =
@@ -2312,11 +2245,9 @@ Sorts a list of records. See also: [Sorting](/orm/prisma-client/queries/filterin
#### Remarks
-- In [2.16.0](https://github.com/prisma/prisma/releases/2.16.0) and later, you can [order by relation fields](#sort-post-by-the-related-user-records-name) - for example, order posts by the author's name.
-
-- In [3.5.0](https://github.com/prisma/prisma/releases/3.5.0) and later, in PostgreSQL you can [order by relevance](#sort-post-by-relevance-of-the-title). For details, see [Sort by relevance](/orm/prisma-client/queries/filtering-and-sorting#sort-by-relevance-postgresql-and-mysql).
-
-- In [4.1.0](https://github.com/prisma/prisma/releases/4.1.0) and later, you can [sort `null` records first or last](#sort-post-by-the-related-user-records-name-with-null-records-first). For details, see [Sort with nulls first or last](/orm/prisma-client/queries/filtering-and-sorting#sort-with-null-records-first-or-last).
+- You can [order by relation fields](#sort-post-by-the-related-user-records-name) - for example, order posts by the author's name.
+- With PostgreSQL you can [order by relevance](#sort-post-by-relevance-of-the-title). For details, see [Sort by relevance](/orm/prisma-client/queries/filtering-and-sorting#sort-by-relevance-postgresql-and-mysql).
+- You can [sort `null` records first or last](#sort-post-by-the-related-user-records-name-with-null-records-first). For details, see [Sort with nulls first or last](/orm/prisma-client/queries/filtering-and-sorting#sort-with-null-records-first-or-last).
#### Inputs for `sort` argument
@@ -2331,7 +2262,7 @@ Note:
- This argument is optional.
- It is for use on optional [scalar](/orm/prisma-schema/data-model/models#scalar-fields) fields only. If you try to sort by nulls on a required or [relation](/orm/prisma-schema/data-model/models#relation-fields) field, Prisma Client throws a [P2009 error](/orm/reference/error-reference#p2009).
-- It is available in version 4.1.0 and later, as a preview feature. See [sort with nulls first or last](/orm/prisma-client/queries/filtering-and-sorting#sort-with-null-records-first-or-last) for details of how to enable the feature.
+- It is available as a preview feature. See [sort with nulls first or last](/orm/prisma-client/queries/filtering-and-sorting#sort-with-null-records-first-or-last) for details of how to enable the feature.
| Name | Description |
| ------- | ------------------------------ |
@@ -3148,7 +3079,7 @@ const user = await prisma.profile.create({
});
```
-In [2.11.0](https://github.com/prisma/prisma/releases/2.11.0) and later, you can set the foreign key directly:
+You can also set the foreign key directly:
```ts
const user = await prisma.profile.create({
@@ -3373,14 +3304,7 @@ A nested `disconnect` query breaks the connection between a parent record and a
#### Remarks
- `disconnect` is only available if the relation is optional.
-- If the relationship you are attempting to disconnect does not exist:
-
- - ([In 2.21.0 and later](https://github.com/prisma/prisma/releases/tag/2.21.0)), the operation does nothing
- - (Before [2.21.0](https://github.com/prisma/prisma/releases/tag/2.21.0)) Prisma Client throws an exception if the provided ID or unique identifier is not connected:
-
- ```
- The records for relation `PostToUser` between the `User` and `Post` models are not connected.
- ```
+- If the relationship you are attempting to disconnect does not exist, the operation does nothing.
#### Examples
@@ -3606,13 +3530,6 @@ const result = await prisma.user.update({
## Filter conditions and operators
-
-
-- From version 4.3.0, you can also use these operators to compare _fields_ in the same model [with the `.fields` property](#compare-columns-in-the-same-table).
-- In versions before 4.3.0, you can compare fields in the same model [with raw queries](/orm/more/help-and-troubleshooting/comparing-columns-through-raw-queries).
-
-
-
### `equals`
Value equals `n`.
@@ -3643,8 +3560,6 @@ const result = await prisma.user.findMany({
##### Return all products with a quantity lower than the "warn quantity" threshold
-This example compares fields of the same model which is available as of version 4.3.0.
-
```ts
const productsWithLowQuantity = await prisma.product.findMany({
where: {
@@ -4390,7 +4305,7 @@ const setTags = await prisma.post.update({
### `push`
-`push` is available in version [2.20.0](https://github.com/prisma/prisma/releases/2.20.0) and later. Use `push` to add _one_ value or _multiple_ values to a scalar list field.
+Use `push` to add _one_ value or _multiple_ values to a scalar list field.
#### Remarks
@@ -4431,8 +4346,7 @@ const addTag = await prisma.post.update({
-This method is available on MongoDB only in versions
-[3.11.1](https://github.com/prisma/prisma/releases/tag/3.11.1) and later.
+This method is only available on MongoDB.
@@ -4461,11 +4375,7 @@ Scalar list filters allow you to filter by the contents of a list / array field.
-Available for:
-
-- PostgreSQL in versions [2.15.0](https://github.com/prisma/prisma/releases/tag/2.15.0) and later
-- CockroachDB in versions [3.9.0](https://github.com/prisma/prisma/releases/tag/3.9.0) and later
-- MongoDB in versions [3.11.0](https://github.com/prisma/prisma/releases/tag/3.11.0) and later
+Available for PostgreSQL, CockroachDB, and MongoDB.
@@ -4563,8 +4473,7 @@ const posts = await prisma.post.findMany({
-This filter is available on MongoDB only in versions
-[3.11.1](https://github.com/prisma/prisma/releases/tag/3.11.1) and later.
+This filter is only available on MongoDB.
@@ -4606,7 +4515,7 @@ const posts = await prisma.post.findMany({
-Available for MongoDB only in Prisma `3.10.0` and later.
+Available for MongoDB only.
@@ -4775,7 +4684,7 @@ const product = prisma.product.update({
-Available for MongoDB only in Prisma `3.11.0` and later.
+Available for MongoDB only.
@@ -5667,19 +5576,6 @@ const validateUserAndPostInput = (name, email, postTitle) => {
You can compare columns in the same table directly, for non-unique filters.
-This feature was moved to general availability in version 5.0.0 and was available via the `fieldReference` Preview feature from Prisma ORM versions 4.3.0 to 4.16.2.
-
-
-
-In the following situations, you must [use raw queries to compare columns in the same table](/orm/more/help-and-troubleshooting/comparing-columns-through-raw-queries):
-
-- If you use a version earlier than 4.3.0
-- If you want to use a unique filter, such as [`findUnique`](#findunique) or [`findUniqueOrThrow`](#finduniqueorthrow)
-- If you want to compare a field with a [unique constraint](/orm/prisma-schema/data-model/models#defining-a-unique-field)
-- If you want to use one of the following operators to compare a [JSON field](/orm/prisma-client/special-fields-and-types/working-with-json-fields) in MySQL or MariaDB with another field: [`gt`](#gt), [`gte`](#gte), [`lt`](#lt), or [`lte`](#lte). Note that you can use these operators to compare the JSON field with a scalar value. This limitation applies only if you try to compare a JSON field with another field.
-
-
-
To compare columns in the same table, use the `.fields` property. In the following example, the query returns all records where the value in the `prisma.product.quantity` field is less than or equal to the value in the `prisma.product.warnQuantity` field.
```ts
@@ -5766,7 +5662,6 @@ await prisma.user.findMany({
## Filter on non-unique fields with `UserWhereUniqueInput`
From version 5.0.0, the generated type `UserWhereUniqueInput` on [`where`](#where) exposes all fields on the model, not just unique fields.
-This was available under the [`extendedWhereUnique` Preview flag](/orm/reference/preview-features/client-preview-features#preview-features-promoted-to-general-availability) between versions 4.5.0 to 4.16.2
You must specify at least one unique field in your `where` statement [outside of boolean operators](#boolean-operators-with-userwhereuniqueinput), and you can specify any number of additional unique and non-unique fields. You can use this to add filters to any operation that returns a single record. For example, you can use this feature for the following:
@@ -5774,13 +5669,11 @@ You must specify at least one unique field in your `where` statement [outside of
- [Permission checks](#permission-checks)
- [Soft deletes](#soft-deletes)
-From version 4.6.0, you can use this feature to filter on optional [one-to-one nested reads](/orm/prisma-client/queries/relation-queries#nested-reads).
-
### Optimistic concurrency control on updates
You can filter on non-unique fields to perform [optimistic concurrency control](/orm/prisma-client/queries/transactions#optimistic-concurrency-control) on `update` operations.
-To perform optimistic concurrency control, we recommend that you use a `version` field to check whether the data in a record or related record has changed while your code executes. Before version 4.5.0, you could not evaluate the `version` field in an `update` operation, because the field is non-unique. From version 4.5.0, you can evaluate the `version` field.
+To perform optimistic concurrency control, we recommend that you use a `version` field to check whether the data in a record or related record has changed while your code executes.
In the following example, `updateOne` and `updateTwo` first read the same record and then attempt to update it. The database only executes these updates if the value in `version` is the same as the value when it did the initial read. When the database executes the first of these updates (which might be `updateOne` or `updateTwo`, depending on timing), it increments the value in `version`. This means that the database does not execute the second update because the value in `version` has changed.
@@ -5871,13 +5764,6 @@ await prisma.user.update({
#### One-to-one relations
-From version 4.5.0, you can filter on non-unique fields in the following operations on [one-to-one relations](/orm/prisma-schema/data-model/relations/one-to-one-relations):
-
-- Nested update
-- Nested upsert
-- Nested disconnect
-- Nested delete
-
Prisma Client automatically uses a unique filter to select the appropriate related record. As a result, you do not need to specify a unique filter in your `where` statement with a `WhereUniqueInput` [generated type](#generated-types-for-where). Instead, the `where` statement has a `WhereInput` generated type. You can use this to filter without the restrictions of `WhereUniqueInput`.
##### Nested update example
@@ -5887,9 +5773,6 @@ await prisma.user.update({
where: { id: 1, },
data: {
to_one: {
- // Before Prisma version 4.5.0
- update: { field: "updated" }
- // From Prisma version 4.5.0, you can also do the following:
update: { where: { /*WhereInput*/ }, data: { field: "updated" } } }
}
}
@@ -5920,9 +5803,6 @@ await prisma.user.update({
where: { id: 1, },
data: {
to_one: {
- // Before Prisma version 4.5.0
- disconnect: true
- // From Prisma version 4.5.0, you can also do the following:
disconnect: { /* WhereInput */ }
}
}
@@ -5936,9 +5816,6 @@ await prisma.user.update({
where: { id: 1, },
data: {
to_one: {
- // Before Prisma version 4.5.0
- delete: true
- // From Prisma version 4.5.0, you can also do the following:
delete: { /* WhereInput */ }
}
}
diff --git a/content/200-orm/500-reference/100-prisma-schema-reference.mdx b/content/200-orm/500-reference/100-prisma-schema-reference.mdx
index 9c8c634416..8aa89ad23f 100644
--- a/content/200-orm/500-reference/100-prisma-schema-reference.mdx
+++ b/content/200-orm/500-reference/100-prisma-schema-reference.mdx
@@ -20,9 +20,9 @@ A `datasource` block accepts the following fields:
| `provider` | **Yes** | String (`postgresql`, `mysql`, `sqlite`, `sqlserver`, `mongodb`, `cockroachdb`) | Describes which data source connectors to use. |
| `url` | **Yes** | String (URL) | Connection URL including authentication info. Most connectors use [the syntax provided by the database](/orm/reference/connection-urls#format). |
| `shadowDatabaseUrl` | No | String (URL) | Connection URL to the shadow database used by Prisma Migrate. Allows you to use a cloud-hosted database as the shadow database. |
-| `directUrl` | No | String (URL) | Connection URL for direct connection to the database.