From b4877cab6531f31db63f0e0a39a73e71faadc1d5 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Tue, 9 Apr 2024 23:04:03 -0600 Subject: [PATCH] fix syncing issues --- .github/workflows/notion.yml | 36 - .../100-connect-your-database.mdx | 551 --- .../150-using-prisma-migrate.mdx | 841 ---- .../110-relational-databases/index.mdx | 300 -- .../120-mongodb/index.mdx | 124 - .../100-connect-your-database.mdx | 521 --- .../150-introspection.mdx | 1324 ------ .../110-relational-databases/index.mdx | 276 -- .../120-mongodb/125-introspection.mdx | 175 - .../120-mongodb/index.mdx | 102 - .../201-serverless/500-deploy-to-netlify.mdx | 2 +- .../301-edge/450-deploy-to-cloudflare.mdx | 27 +- .../02-schema-incompatibilities.mdx | 854 ---- .../03-upgrading-the-prisma-layer.mdx | 1608 ------- content/400-pulse/700-feedback.mdx | 1 - gatsby-node.ts | 228 - src/components/footer.tsx | 529 --- src/components/layout.tsx | 231 - src/components/pageBottom.tsx | 338 -- src/components/shortcodes/index.tsx | 106 - src/components/sidebar/index.tsx | 121 - src/components/sidebar/treeNode.tsx | 312 -- src/hooks/useAllArticlesQuery.ts | 38 - src/html.tsx | 59 - src/interfaces/Article.interface.ts | 57 - src/utils/treeData.ts | 129 - vercel.json | 3811 ----------------- 27 files changed, 13 insertions(+), 12688 deletions(-) delete mode 100644 .github/workflows/notion.yml delete mode 100644 content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/100-connect-your-database.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/150-using-prisma-migrate.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/index.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/index.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/index.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection.mdx delete mode 100644 content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/index.mdx delete mode 100644 content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/02-schema-incompatibilities.mdx delete mode 100644 content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx delete mode 100644 gatsby-node.ts delete mode 100644 src/components/footer.tsx delete mode 100644 src/components/layout.tsx delete mode 100644 src/components/pageBottom.tsx delete mode 100644 src/components/shortcodes/index.tsx delete mode 100644 src/components/sidebar/index.tsx delete mode 100644 src/components/sidebar/treeNode.tsx delete mode 100644 src/hooks/useAllArticlesQuery.ts delete mode 100644 src/html.tsx delete mode 100644 src/interfaces/Article.interface.ts delete mode 100644 src/utils/treeData.ts delete mode 100644 vercel.json diff --git a/.github/workflows/notion.yml b/.github/workflows/notion.yml deleted file mode 100644 index 7090581aed..0000000000 --- a/.github/workflows/notion.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Notion Board -on: - issues: - issue_comment: - workflow_dispatch: - inputs: - setup: - description: 'Populate your notion database with all the required properties' - type: boolean - syncIssues: - description: 'sync all other existing issues in this repo' - type: boolean - issueType: - type: choice - description: 'The issue type you want to sync' - options: - - all - - open - - closed - default: open -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Notion Board - uses: Souvikns/Notion-Board@2.2.0 - with: - setup: ${{github.event.inputs.setup}} - syncIssues: ${{github.event.inputs.syncIssues}} - issueType: ${{github.event.inputs.issueType}} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} - NOTION_DATABASE: ${{ secrets.NOTION_DATABASE }} diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/100-connect-your-database.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/100-connect-your-database.mdx deleted file mode 100644 index e2f7b0fe20..0000000000 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/100-connect-your-database.mdx +++ /dev/null @@ -1,551 +0,0 @@ ---- -title: 'Connect your database' -metaTitle: 'Connect your database' -metaDescription: 'Connect your database to your project' -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] -toc: false ---- - -## Connect your database - -To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](/orm/reference/connection-urls): - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -In this case, the `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" -``` - - - -We recommend adding `.env` to your `.gitignore` file to prevent committing your environment variables. - - - -You now need to adjust the connection URL to point to your own database. - -The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. For PostgreSQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `HOST`: The name of your host name (for the local environment, it is `localhost`) -- `PORT`: The port where your database server is running (typically `5432` for PostgreSQL) -- `DATABASE`: The name of the [database](https://www.postgresql.org/docs/12/manage-ag-overview.html) -- `SCHEMA`: The name of the [schema](https://www.postgresql.org/docs/12/ddl-schemas.html) inside the database - -If you're unsure what to provide for the `schema` parameter for a PostgreSQL connection URL, you can probably omit it. In that case, the default schema name `public` will be used. - -As an example, for a PostgreSQL database hosted on Heroku, the [connection URL](/orm/reference/connection-urls) might look similar to this: - -```bash file=.env -DATABASE_URL="postgresql://opnmyfngbknppm:XXX@ec2-46-137-91-216.eu-west-1.compute.amazonaws.com:5432/d50rgmkqi2ipus?schema=hello-prisma" -``` - -When running PostgreSQL locally on macOS, your user and password as well as the database name _typically_ correspond to the current _user_ of your OS, e.g. assuming the user is called `janedoe`: - -```bash file=.env -DATABASE_URL="postgresql://janedoe:janedoe@localhost:5432/janedoe?schema=hello-prisma" -``` - - - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL, so you first need to switch the `provider` to `mysql`: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "mysql" - url = env("DATABASE_URL") -} -``` - -In this case, the `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="mysql://johndoe:randompassword@localhost:3306/mydb" -``` - - - -We recommend adding `.env` to your `.gitignore` file to prevent committing your environment variables. - - - -You now need to adjust the connection URL to point to your own database. - -The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. For MySQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -mysql://USER:PASSWORD@HOST:PORT/DATABASE -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running (typically `3306` for MySQL) -- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html) - -As an example, for a MySQL database hosted on AWS RDS, the [connection URL](/orm/reference/connection-urls) might look similar to this: - -```bash file=.env -DATABASE_URL="mysql://johndoe:XXX@mysql–instance1.123456789012.us-east-1.rds.amazonaws.com:3306/mydb" -``` - -When running MySQL locally, your connection URL typically looks similar to this: - -```bash file=.env -DATABASE_URL="mysql://root:randompassword@localhost:3306/mydb" -``` - - - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL as the `provider`. For PlanetScale, you need to edit the `datasource` block to use the `mysql` provider instead: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "mysql" - url = env("DATABASE_URL") -} -``` - -You will also need to set the relation mode type to `prisma` in order to [emulate foreign key constraints](/orm/overview/databases/planetscale#option-1-emulate-relations-in-prisma-client) in the `datasource` block: - -```prisma file=schema.prisma highlight=4;add -datasource db { - provider = "mysql" - url = env("DATABASE_URL") - relationMode = "prisma" -} -``` - -> **Note**: Since February 2024, you can alternatively [use foreign key constraints on a database-level in PlanetScale](/orm/overview/databases/planetscale#option-2-enable-foreign-key-constraints-in-the-planetscale-database-settings), which omits the need for setting `relationMode = "prisma"`. - -The `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="mysql://janedoe:mypassword@server.us-east-2.psdb.cloud/mydb?sslaccept=strict" -``` - -You now need to adjust the connection URL to point to your own database. - -The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. PlanetScale uses the MySQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -mysql://USER:PASSWORD@HOST:PORT/DATABASE -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running (typically `3306` for MySQL) -- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html) - -For a database hosted with PlanetScale, the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="mysql://myusername:mypassword@server.us-east-2.psdb.cloud/mydb?sslaccept=strict" -``` - -The connection URL for a given database branch can be found from your PlanetScale account by going to the overview page for the branch and selecting the 'Connect' dropdown. In the 'Passwords' section, generate a new password and select 'Prisma' to get the Prisma format for the connection URL. - -
Alternative method: connecting using the PlanetScale CLI - -Alternatively, you can connect to your PlanetScale database server using the [PlanetScale CLI](https://docs.planetscale.com/reference/planetscale-environment-setup), and use a local connection URL. In this case the connection URL will look like this: - -```bash file=.env -DATABASE_URL="mysql://root@localhost:PORT/mydb" -``` - - - -We recommend adding `.env` to your `.gitignore` file to prevent committing your environment variables. - - - -To connect to your branch, use the following command: - -```terminal -pscale connect prisma-test branchname --port PORT -``` - -The `--port` flag can be omitted if you are using the default port `3306`. - -
- -
- - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "sqlserver" - url = env("DATABASE_URL") -} -``` - -In this case, the `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`: - -The following example connection URL [uses SQL authentication](/orm/overview/databases/sql-server), but there are [other ways to format your connection URL](/orm/overview/databases/sql-server) - -```bash file=.env - DATABASE_URL="sqlserver://localhost:1433;database=mydb;user=sa;password=r@ndomP@$$w0rd;trustServerCertificate=true" -``` - - - -We recommend adding `.env` to your `.gitignore` file to prevent committing your environment variables. - - - -Adjust the connection URL to match your setup - see [Microsoft SQL Server connection URL](/orm/overview/databases/sql-server) for more information. - -> Make sure TCP/IP connections are enabled via [SQL Server Configuration Manager](https://docs.microsoft.com/en-us/sql/relational-databases/sql-server-configuration-manager) to avoid `No connection could be made because the target machine actively refused it. (os error 10061)` - - - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL as the `provider`. For CockroachDB, you need to edit the `datasource` block to use the `cockroachdb` provider instead: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "cockroachdb" - url = env("DATABASE_URL") -} -``` - -The `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`. You now need to adjust the connection URL to point to your own database. - -The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. CockroachDB uses the PostgreSQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -postgresql://USER:PASSWORD@HOST:PORT/DATABASE?PARAMETERS -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running. The default for CockroachDB is `26257`. -- `DATABASE`: The name of the database -- `PARAMETERS`: Any additional connection parameters. See the CockroachDB documentation [here](https://www.cockroachlabs.com/docs/stable/connection-parameters.html#additional-connection-parameters). - -For a [CockroachDB Serverless](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart.html) or [Cockroach Dedicated](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart-trial-cluster) database hosted on [CockroachDB Cloud](https://www.cockroachlabs.com/get-started-cockroachdb/), the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="postgresql://:@..cockroachlabs.cloud:26257/defaultdb?sslmode=verify-full&sslrootcert=$HOME/.postgresql/root.crt&options=--" -``` - -To find your connection string on CockroachDB Cloud, click the 'Connect' button on the overview page for your database cluster, and select the 'Connection string' tab. - -For a [CockroachDB database hosted locally](https://www.cockroachlabs.com/docs/stable/secure-a-cluster.html), the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="postgresql://root@localhost:26257?sslmode=disable" -``` - -Your connection string is displayed as part of the welcome text when starting CockroachDB from the command line. - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Creating the database schema - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Creating the database schema - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - - - - - - - - Installation - - - - Using Prisma Migrate - - - - - diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/150-using-prisma-migrate.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/150-using-prisma-migrate.mdx deleted file mode 100644 index fcc8b432ca..0000000000 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/150-using-prisma-migrate.mdx +++ /dev/null @@ -1,841 +0,0 @@ ---- -title: 'Using Prisma Migrate' -metaTitle: 'Using Prisma Migrate' -metaDescription: 'Create database tables with Prisma Migrate' -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] -toc: false ---- - -## Creating the database schema - - - -In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your [Prisma schema](/orm/prisma-schema) in `prisma/schema.prisma`: - -```prisma file=prisma/schema.prisma copy -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -To map your data model to the database schema, you need to use the `prisma migrate` CLI commands: - -```terminal -npx prisma migrate dev --name init -``` - -This command does two things: - -1. It creates a new SQL migration file for this migration -1. It runs the SQL migration file against the database - -> **Note**: `generate` is called under the hood by default, after running `prisma migrate dev`. If the `prisma-client-js` generator is defined in your schema, this will check if `@prisma/client` is installed and install it if it's missing. - -Great, you now created three tables in your database with Prisma Migrate 🚀 - - - - - -In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`: - -```prisma file=prisma/schema.prisma copy -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -To map your data model to the database schema, you need to use the `prisma migrate` CLI commands: - -```terminal -npx prisma migrate dev --name init -``` - -This command does two things: - -1. It creates a new SQL migration file for this migration -1. It runs the SQL migration file against the database - -> **Note**: `generate` is called under the hood by default, after running `prisma migrate dev`. If the `prisma-client-js` generator is defined in your schema, this will check if `@prisma/client` is installed and install it if it's missing. - -Great, you now created three tables in your database with Prisma Migrate 🚀 - - - - - -In this guide, you'll use Prisma's [`db push` command](/orm/prisma-migrate/workflows/prototyping-your-schema) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`: - -```prisma file=prisma/schema.prisma copy -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int - - @@index(authorId) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique - - @@index(userId) -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -You are now ready to push your new schema to your database. Connect to your `main` branch using the instructions in [Connect your database](/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-planetscale). - -Now use the `db push` CLI command to push to the `main` branch: - -```terminal -npx prisma db push -``` - -Great, you now created three tables in your database with Prisma's `db push` command 🚀 - - - - - -In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`: - -```prisma file=prisma/schema.prisma copy -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -To map your data model to the database schema, you need to use the `prisma migrate` CLI commands: - -```terminal -npx prisma migrate dev --name init -``` - -This command does two things: - -1. It creates a new SQL migration file for this migration -1. It runs the SQL migration file against the database - -> **Note**: `generate` is called under the hood by default, after running `prisma migrate dev`. If the `prisma-client-js` generator is defined in your schema, this will check if `@prisma/client` is installed and install it if it's missing. - -Great, you now created three tables in your database with Prisma Migrate 🚀 - - - - - -, ]}> - - - -```sql -CREATE TABLE "Post" ( - "id" SERIAL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "title" VARCHAR(255) NOT NULL, - "content" TEXT, - "published" BOOLEAN NOT NULL DEFAULT false, - "authorId" INTEGER NOT NULL, - PRIMARY KEY ("id") -); - -CREATE TABLE "Profile" ( - "id" SERIAL, - "bio" TEXT, - "userId" INTEGER NOT NULL, - PRIMARY KEY ("id") -); - -CREATE TABLE "User" ( - "id" SERIAL, - "email" TEXT NOT NULL, - "name" TEXT, - PRIMARY KEY ("id") -); - -CREATE UNIQUE INDEX "Profile.userId_unique" ON "Profile"("userId"); -CREATE UNIQUE INDEX "User.email_unique" ON "User"("email"); -ALTER TABLE "Post" ADD FOREIGN KEY("authorId")REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE "Profile" ADD FOREIGN KEY("userId")REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -``` - - - - - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `TEXT` | No | No | No | - | -| `email` | `TEXT` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `TIMESTAMP` | No | No | **✔️** | `now()` | -| `updatedAt` | `TIMESTAMP` | No | No | **✔️** | | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `TEXT` | No | No | No | - | -| `published` | `BOOLEAN` | No | No | **✔️** | `false` | -| `authorId` | `INTEGER` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `TEXT` | No | No | No | - | -| `userId` | `INTEGER` | No | **✔️** | **✔️** | - | - - - - - - - - - -, ]}> - - - -```sql -CREATE TABLE "Post" ( - "id" SERIAL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "title" TEXT NOT NULL, - "content" TEXT, - "published" BOOLEAN NOT NULL DEFAULT false, - "authorId" INTEGER NOT NULL, - PRIMARY KEY ("id") -); - -CREATE TABLE "Profile" ( - "id" SERIAL, - "bio" TEXT, - "userId" INTEGER NOT NULL, - PRIMARY KEY ("id") -); - -CREATE TABLE "User" ( - "id" SERIAL, - "email" TEXT NOT NULL, - "name" TEXT, - PRIMARY KEY ("id") -); - -CREATE UNIQUE INDEX "Profile.userId_unique" ON "Profile"("userId"); -CREATE UNIQUE INDEX "User.email_unique" ON "User"("email"); -ALTER TABLE "Post" ADD FOREIGN KEY("authorId")REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE "Profile" ADD FOREIGN KEY("userId")REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -``` - - - - - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `TEXT` | No | No | No | - | -| `email` | `TEXT` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `TIMESTAMP` | No | No | **✔️** | `now()` | -| `updatedAt` | `TIMESTAMP` | No | No | **✔️** | | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `TEXT` | No | No | No | - | -| `published` | `BOOLEAN` | No | No | **✔️** | `false` | -| `authorId` | `INTEGER` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `TEXT` | No | No | No | - | -| `userId` | `INTEGER` | No | **✔️** | **✔️** | - | - - - - - - - - - -, ]}> - - - -```sql -CREATE TABLE `Post` ( - `id` int NOT NULL AUTO_INCREMENT, - `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - `updatedAt` datetime(3) NOT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `content` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `published` tinyint(1) NOT NULL DEFAULT '0', - `authorId` int NOT NULL, - PRIMARY KEY (`id`), - KEY `Post_authorId_idx` (`authorId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -CREATE TABLE `Profile` ( - `id` int NOT NULL AUTO_INCREMENT, - `bio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `userId` int NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `Profile_userId_key` (`userId`), - KEY `Profile_userId_idx` (`userId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -CREATE TABLE `User` ( - `id` int NOT NULL AUTO_INCREMENT, - `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `User_email_key` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -``` - - - - - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `varchar(191)` | No | No | No | - | -| `email` | `varchar(191)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `datetime(3)` | No | No | **✔️** | `now()` | -| `updatedAt` | `datetime(3)` | No | No | **✔️** | | -| `title` | `varchar(255)` | No | No | **✔️** | - | -| `content` | `varchar(191)` | No | No | No | - | -| `published` | `tinyint(1)` | No | No | **✔️** | `false` | -| `authorId` | `int` | No | No | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `varchar(191)` | No | No | No | - | -| `userId` | `int` | No | No | **✔️** | - | - - - - - - - - - -, ]}> - - - -```sql -BEGIN TRY - -BEGIN TRAN; - --- CreateTable -CREATE TABLE [dbo].[Post] ( - [id] INT NOT NULL IDENTITY(1,1), - [createdAt] DATETIME2 NOT NULL CONSTRAINT [Post_createdAt_df] DEFAULT CURRENT_TIMESTAMP, - [updatedAt] DATETIME2 NOT NULL, - [title] VARCHAR(255) NOT NULL, - [content] NVARCHAR(1000), - [published] BIT NOT NULL CONSTRAINT [Post_published_df] DEFAULT 0, - [authorId] INT NOT NULL, - CONSTRAINT [Post_pkey] PRIMARY KEY ([id]) -); - --- CreateTable -CREATE TABLE [dbo].[Profile] ( - [id] INT NOT NULL IDENTITY(1,1), - [bio] NVARCHAR(1000), - [userId] INT NOT NULL, - CONSTRAINT [Profile_pkey] PRIMARY KEY ([id]), - CONSTRAINT [Profile_userId_key] UNIQUE ([userId]) -); - --- CreateTable -CREATE TABLE [dbo].[User] ( - [id] INT NOT NULL IDENTITY(1,1), - [email] NVARCHAR(1000) NOT NULL, - [name] NVARCHAR(1000), - CONSTRAINT [User_pkey] PRIMARY KEY ([id]), - CONSTRAINT [User_email_key] UNIQUE ([email]) -); - --- AddForeignKey -ALTER TABLE [dbo].[Post] ADD CONSTRAINT [Post_authorId_fkey] FOREIGN KEY ([authorId]) REFERENCES [dbo].[User]([id]) ON DELETE NO ACTION ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE [dbo].[Profile] ADD CONSTRAINT [Profile_userId_fkey] FOREIGN KEY ([userId]) REFERENCES [dbo].[User]([id]) ON DELETE NO ACTION ON UPDATE CASCADE; - -COMMIT TRAN; - -END TRY -BEGIN CATCH - -IF @@TRANCOUNT > 0 -BEGIN - ROLLBACK TRAN; -END; -THROW - -END CATCH -``` - - - - - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `NVARCHAR(1000)` | No | No | No | - | -| `email` | `NVARCHAR(1000)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `DATETIME2` | No | No | **✔️** | `now()` | -| `updatedAt` | `DATETIME2` | No | No | **✔️** | | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `NVARCHAR(1000)` | No | No | No | - | -| `published` | `BIT` | No | No | **✔️** | `false` | -| `authorId` | `INT` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `NVARCHAR(1000)` | No | No | No | - | -| `userId` | `INT` | No | **✔️** | **✔️** | - | - - - - - - - - - -In this guide, you'll use [Prisma Migrate](/orm/prisma-migrate) to create the tables in your database. Add the following data model to your Prisma schema in `prisma/schema.prisma`: - -```prisma file=prisma/schema.prisma copy -model Post { - id BigInt @id @default(sequence()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId BigInt -} - -model Profile { - id BigInt @id @default(sequence()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId BigInt @unique -} - -model User { - id BigInt @id @default(sequence()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -To map your data model to the database schema, you need to use the `prisma migrate` CLI commands: - -```terminal -npx prisma migrate dev --name init -``` - -This command does two things: - -1. It creates a new SQL migration file for this migration -1. It runs the SQL migration file against the database - -> **Note**: `generate` is called under the hood by default, after running `prisma migrate dev`. If the `prisma-client-js` generator is defined in your schema, this will check if `@prisma/client` is installed and install it if it's missing. - -Great, you now created three tables in your database with Prisma Migrate 🚀 - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/index.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/index.mdx deleted file mode 100644 index b6761c67f5..0000000000 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/index.mdx +++ /dev/null @@ -1,300 +0,0 @@ ---- -title: 'Relational databases' -metaTitle: 'Start from scratch with relational databases (15 min)' -metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your relational database and generating a Prisma Client for database access.' -duration: '15 min' -toc: false -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] ---- - - - -Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma ORM to your database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Migrate](/orm/prisma-migrate). - - - -## Prerequisites - -In order to successfully complete this guide, you need: - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [PostgreSQL](https://www.postgresql.org/) database server running - - - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [CockroachDB](https://www.cockroachlabs.com/) database server running - - - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [MySQL](https://www.mysql.com/) database server running - - - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [PlanetScale](https://www.planetscale.com/) database server running - - - -This tutorial will also assume that you can push to the `main` branch of your database. Do not do this if your `main` branch has been promoted to production. - - - - - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- A [Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/?view=sql-server-ver15) database - - [Microsoft SQL Server on Linux for Docker](/orm/overview/databases/sql-server/sql-server-docker) - - [Microsoft SQL Server on Windows (local)](/orm/overview/databases/sql-server/sql-server-local) - - - -> See [System requirements](/orm/reference/system-requirements) for exact version requirements. - -Make sure you have your database [connection URL](/orm/reference/connection-urls) at hand. If you don't have a database server running and just want to explore Prisma ORM, check out the [Quickstart](/getting-started/quickstart). - -## Create project setup - -As a first step, create a project directory and navigate into it: - -```terminal copy -mkdir hello-prisma -cd hello-prisma -``` - - - -Next, initialize a TypeScript project and add the Prisma CLI as a development dependency to it: - -```terminal copy -npm init -y -npm install prisma typescript ts-node @types/node --save-dev -``` - -This creates a `package.json` with an initial setup for your TypeScript app. - -Next, initialize TypeScript: - -```terminal copy -npx tsc --init -``` - - - - - -Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: - -```terminal copy -npm init -y -npm install prisma --save-dev -``` - -This creates a `package.json` with an initial setup for a Node.js app. - - - - - -See [installation instructions](/orm/tools/prisma-cli#installation) to learn how to install Prisma using a different package manager. - - - -You can now invoke the Prisma CLI by prefixing it with `npx`: - -```terminal -npx prisma -``` - -Next, set up your Prisma ORM project by creating your [Prisma schema](/orm/prisma-schema) file with the following command: - -```terminal copy -npx prisma init -``` - -This command does two things: - -- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models -- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/index.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/index.mdx deleted file mode 100644 index bf36122cbe..0000000000 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/index.mdx +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: 'MongoDB' -metaTitle: 'Start from scratch with MongoDB (15 min)' -metaDescription: 'Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma to your MongoDB database and generating a Prisma Client for database access.' -duration: '15 min' -toc: false -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['mongodb'] ---- - - - -Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma ORM to your MongoDB database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli) and [Prisma Client](/orm/prisma-client). - - - -## Prerequisites - -In order to successfully complete this guide, you need: - -- [Node.js](https://nodejs.org/en/) installed on your machine -- Access to a MongoDB 4.2+ server with a replica set deployment. We recommend using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas). - - - - The MongoDB database connector uses transactions to support nested writes. Transactions **require** a [replica set](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/) deployment. The easiest way to deploy a replica set is with [Atlas](https://docs.atlas.mongodb.com/getting-started/). It's free to get started. - - - -Make sure you have your database [connection URL](/orm/reference/connection-urls) at hand. If you don't have a database server running and just want to explore Prisma ORM, check out the [Quickstart](/getting-started/quickstart). - -> See [System requirements](/orm/reference/system-requirements) for exact version requirements. - -## Create project setup - -As a first step, create a project directory and navigate into it: - -```terminal copy -mkdir hello-prisma -cd hello-prisma -``` - - - -Next, initialize a TypeScript project and add the Prisma CLI as a development dependency to it: - -```terminal copy -npm init -y -npm install prisma typescript ts-node @types/node --save-dev -``` - -This creates a `package.json` with an initial setup for your TypeScript app. - -Next, initialize TypeScript: - -```terminal copy -npx tsc --init -``` - - - - - -Next, initialize a Node.js project and add the Prisma CLI as a development dependency to it: - -```terminal copy -npm init -y -npm install prisma --save-dev -``` - -This creates a `package.json` with an initial setup for a Node.js app. - - - -You can now invoke the Prisma CLI by prefixing it with `npx`: - -```terminal -npx prisma -``` - -Next, set up your Prisma ORM project by creating your [Prisma schema](/orm/prisma-schema) file with the following command: - -```terminal copy -npx prisma init -``` - -This command does two things: - -- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models -- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx deleted file mode 100644 index 3dc099358c..0000000000 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/100-connect-your-database.mdx +++ /dev/null @@ -1,521 +0,0 @@ ---- -title: 'Connect your database' -metaTitle: 'Connect your database' -metaDescription: 'Connect your database to your project' -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] -toc: false ---- - -## Connecting your database - -To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](/orm/reference/connection-urls): - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -In this case, the `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" -``` - -You now need to adjust the connection URL to point to your own database. - -

Connection URL

- -The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. For PostgreSQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA -``` - -> **Note**: In most cases, you can use the [`postgres://` and `postgresql:// URI scheme designators interchangeably`](https://www.postgresql.org/docs/10/libpq-connect.html#id-1.7.3.8.3.6) - however, depending on how your database is hosted, you might need to be specific. - -If you're unsure what to provide for the `schema` parameter for a PostgreSQL connection URL, you can probably omit it. In that case, the default schema name `public` will be used. - -As an example, for a PostgreSQL database hosted on Heroku, the connection URL might look similar to this: - -```bash file=.env -DATABASE_URL="postgresql://opnmyfngbknppm:XXX@ec2-46-137-91-216.eu-west-1.compute.amazonaws.com:5432/d50rgmkqi2ipus?schema=hello-prisma" -``` - -When running PostgreSQL locally on macOS, your user and password as well as the database name _typically_ correspond to the current _user_ of your OS, e.g. assuming the user is called `janedoe`: - -```bash file=.env -DATABASE_URL="postgresql://janedoe:janedoe@localhost:5432/janedoe?schema=hello-prisma" -``` - -
- - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL, so you first need to switch the `provider` to `mysql`: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "mysql" - url = env("DATABASE_URL") -} -``` - -In this case, the `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="mysql://johndoe:randompassword@localhost:3306/mydb" -``` - -You now need to adjust the connection URL to point to your own database. - -

Connection URL

- -The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. For MySQL, it looks as follows (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -mysql://USER:PASSWORD@HOST:PORT/DATABASE -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running (typically `3306` for MySQL) -- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html) - -As an example, for a MySQL database hosted on AWS RDS, the [connection URL](/orm/reference/connection-urls) might look similar to this: - -```bash file=.env -DATABASE_URL="mysql://johndoe:XXX@mysql–instance1.123456789012.us-east-1.rds.amazonaws.com:3306/mydb" -``` - -When running MySQL locally, your connection URL typically looks similar to this: - -```bash file=.env -DATABASE_URL="mysql://root:randompassword@localhost:3306/mydb" -``` - -
- - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL as the `provider`. For PlanetScale, you need to edit the `datasource` block to use the `mysql` provider instead: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "mysql" - url = env("DATABASE_URL") -} -``` - -You will also need to set the relation mode type to `prisma` in order to [emulate foreign key constraints](/orm/overview/databases/planetscale#option-1-emulate-relations-in-prisma-client) in the `datasource` block: - -```prisma file=schema.prisma highlight=4;add -datasource db { - provider = "mysql" - url = env("DATABASE_URL") - relationMode = "prisma" -} -``` - -> **Note**: Since February 2024, you can alternatively [use foreign key constraints on a database-level in PlanetScale](/orm/overview/databases/planetscale#option-2-enable-foreign-key-constraints-in-the-planetscale-database-settings), which omits the need for setting `relationMode = "prisma"`. - -The `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema) which is defined in `.env`: - -```bash file=.env -DATABASE_URL="mysql://janedoe:mypassword@server.us-east-2.psdb.cloud/mydb?sslaccept=strict" -``` - -You now need to adjust the connection URL to point to your own database. - -

Connection URL

- -The [format of the connection URL](/orm/reference/connection-urls) for your database typically depends on the database you use. PlanetScale uses the MySQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -mysql://USER:PASSWORD@HOST:PORT/DATABASE -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running (typically `3306` for MySQL) -- `DATABASE`: The name of the [database](https://dev.mysql.com/doc/refman/8.0/en/creating-database.html) - -For a database hosted with PlanetScale, the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="mysql://myusername:mypassword@server.us-east-2.psdb.cloud/mydb?sslaccept=strict" -``` - -The connection URL for a given database branch can be found from your PlanetScale account by going to the overview page for the branch and selecting the 'Connect' dropdown. In the 'Passwords' section, generate a new password and select 'Prisma' to get the Prisma format for the connection URL. - -
Alternative method: connecting using the PlanetScale CLI - -Alternatively, you can connect to your PlanetScale database server using the [PlanetScale CLI](https://docs.planetscale.com/reference/planetscale-environment-setup), and use a local connection URL. In this case the connection URL will look like this: - -```bash file=.env -DATABASE_URL="mysql://root@localhost:PORT/mydb" -``` - -To connect to your branch, use the following command: - -```terminal -pscale connect prisma-test branchname --port PORT -``` - -The `--port` flag can be omitted if you are using the default port `3306`. - -
- -
- - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "sqlserver" - url = env("DATABASE_URL") -} -``` - -The `url` is [set via an environment variable](/orm/prisma-schema/overview#accessing-environment-variables-from-the-schema), the following example connection URL [uses SQL authentication](/orm/overview/databases/sql-server), but there are [other ways to format your connection URL](/orm/overview/databases/sql-server) - -```bash file=.env -DATABASE_URL="sqlserver://localhost:1433;database=mydb;user=sa;password=r@ndomP@$$w0rd;trustServerCertificate=true" -``` - -Adjust the connection URL to match your setup - see [Microsoft SQL Server connection URL](/orm/overview/databases/sql-server) for more information. - -> Make sure TCP/IP connections are enabled via [SQL Server Configuration Manager](https://docs.microsoft.com/en-us/sql/relational-databases/sql-server-configuration-manager) to avoid `No connection could be made because the target machine actively refused it. (os error 10061)` - - - - - -```prisma file=prisma/schema.prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -Note that the default schema created by `prisma init` uses PostgreSQL as the `provider`. For CockroachDB, you need to edit the `datasource` block to use the `cockroachdb` provider instead: - -```prisma file=prisma/schema.prisma highlight=2;edit -datasource db { - provider = "cockroachdb" - url = env("DATABASE_URL") -} -``` - -The `url` is [set via an environment variable](/orm/more/development-environment/environment-variables) which is defined in `.env`. You now need to adjust the connection URL to point to your own database. - -

Connection URL

- -The [format of the connection URL](/orm/reference/connection-urls) for your database depends on the database you use. CockroachDB uses the PostgreSQL connection URL format, which has the following structure (the parts spelled all-uppercased are _placeholders_ for your specific connection details): - -```no-lines -postgresql://USER:PASSWORD@HOST:PORT/DATABASE?PARAMETERS -``` - -Here's a short explanation of each component: - -- `USER`: The name of your database user -- `PASSWORD`: The password for your database user -- `PORT`: The port where your database server is running. The default for CockroachDB is `26257`. -- `DATABASE`: The name of the database -- `PARAMETERS`: Any additional connection parameters. See the CockroachDB documentation [here](https://www.cockroachlabs.com/docs/stable/connection-parameters.html#additional-connection-parameters). - -For a [CockroachDB Serverless](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart.html) or [Cockroach Dedicated](https://www.cockroachlabs.com/docs/cockroachcloud/quickstart-trial-cluster) database hosted on [CockroachDB Cloud](https://www.cockroachlabs.com/get-started-cockroachdb/), the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="postgresql://:@..cockroachlabs.cloud:26257/defaultdb?sslmode=verify-full&sslrootcert=$HOME/.postgresql/root.crt&options=--" -``` - -To find your connection string on CockroachDB Cloud, click the 'Connect' button on the overview page for your database cluster, and select the 'Connection string' tab. - -For a [CockroachDB database hosted locally](https://www.cockroachlabs.com/docs/stable/secure-a-cluster.html), the [connection URL](/orm/reference/connection-urls) looks similar to this: - -```bash file=.env -DATABASE_URL="postgresql://root@localhost:26257?sslmode=disable" -``` - -Your connection string is displayed as part of the welcome text when starting CockroachDB from the command line. - -
- - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - - - - - - - - Installation - - - - Introspection - - - - - diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx deleted file mode 100644 index 35279526d0..0000000000 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx +++ /dev/null @@ -1,1324 +0,0 @@ ---- -title: 'Introspection' -metaTitle: 'Introspection' -metaDescription: 'Introspection your database with Prisma' -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] -toc: false ---- - -## Introspect your database with Prisma ORM - - - -For the purpose of this guide, we'll use a demo SQL schema with three tables: - -```sql no-lines -CREATE TABLE "public"."User" ( - id SERIAL PRIMARY KEY NOT NULL, - name VARCHAR(255), - email VARCHAR(255) UNIQUE NOT NULL -); - -CREATE TABLE "public"."Post" ( - id SERIAL PRIMARY KEY NOT NULL, - title VARCHAR(255) NOT NULL, - "createdAt" TIMESTAMP NOT NULL DEFAULT now(), - content TEXT, - published BOOLEAN NOT NULL DEFAULT false, - "authorId" INTEGER NOT NULL, - FOREIGN KEY ("authorId") REFERENCES "public"."User"(id) -); - -CREATE TABLE "public"."Profile" ( - id SERIAL PRIMARY KEY NOT NULL, - bio TEXT, - "userId" INTEGER UNIQUE NOT NULL, - FOREIGN KEY ("userId") REFERENCES "public"."User"(id) -); -``` - -> **Note**: Some fields are written in double-quotes to ensure PostgreSQL uses proper casing. If no double-quotes were used, PostgreSQL would just read everything as _lowercase_ characters. - -
Expand for a graphical overview of the tables - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `SERIAL` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `VARCHAR(255)` | No | No | No | - | -| `email` | `VARCHAR(255)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `SERIAL` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `TIMESTAMP` | No | No | **✔️** | `now()` | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `TEXT` | No | No | No | - | -| `published` | `BOOLEAN` | No | No | **✔️** | `false` | -| `authorId` | `INTEGER` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `SERIAL` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `TEXT` | No | No | No | - | -| `userId` | `INTEGER` | No | **✔️** | **✔️** | - | - -
- -
- - - -For the purpose of this guide, we'll use a demo SQL schema with three tables: - -```sql no-lines -CREATE TABLE User ( - id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL, - name VARCHAR(255), - email VARCHAR(255) UNIQUE NOT NULL -); - -CREATE TABLE Post ( - id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL, - title VARCHAR(255) NOT NULL, - createdAt TIMESTAMP NOT NULL DEFAULT now(), - content TEXT, - published BOOLEAN NOT NULL DEFAULT false, - authorId INTEGER NOT NULL, - FOREIGN KEY (authorId) REFERENCES User(id) -); - -CREATE TABLE Profile ( - id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL, - bio TEXT, - userId INTEGER UNIQUE NOT NULL, - FOREIGN KEY (userId) REFERENCES User(id) -); -``` - -
Expand for a graphical overview of the tables - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `VARCHAR(255)` | No | No | No | - | -| `email` | `VARCHAR(255)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `DATETIME(3)` | No | No | **✔️** | `now()` | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `TEXT` | No | No | No | - | -| `published` | `BOOLEAN` | No | No | **✔️** | `false` | -| `authorId` | `INTEGER` | No | **✔️** | **✔️** | `false` | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :-------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INTEGER` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `TEXT` | No | No | No | - | -| `userId` | `INTEGER` | No | **✔️** | **✔️** | - | - -
- -
- - - -For the purpose of this guide, we'll use a demo SQL schema with three tables: - -```sql no-lines -CREATE TABLE `Post` ( - `id` int NOT NULL AUTO_INCREMENT, - `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - `updatedAt` datetime(3) NOT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `content` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `published` tinyint(1) NOT NULL DEFAULT '0', - `authorId` int NOT NULL, - PRIMARY KEY (`id`), - KEY `Post_authorId_idx` (`authorId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -CREATE TABLE `Profile` ( - `id` int NOT NULL AUTO_INCREMENT, - `bio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `userId` int NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `Profile_userId_key` (`userId`), - KEY `Profile_userId_idx` (`userId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -CREATE TABLE `User` ( - `id` int NOT NULL AUTO_INCREMENT, - `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `User_email_key` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -``` - -
Expand for a graphical overview of the tables - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `datetime(3)` | No | No | **✔️** | `now()` | -| `updatedAt` | `datetime(3)` | No | No | **✔️** | | -| `title` | `varchar(255)` | No | No | **✔️** | - | -| `content` | `varchar(191)` | No | No | No | - | -| `published` | `tinyint(1)` | No | No | **✔️** | `false` | -| `authorId` | `int` | No | No | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `varchar(191)` | No | No | No | - | -| `userId` | `int` | No | No | **✔️** | - | - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `int` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `varchar(191)` | No | No | No | - | -| `email` | `varchar(191)` | No | No | **✔️** | - | - -
- -
- - - -For the purpose of this guide, we'll use a demo SQL schema with three tables: - -```sql no-lines -CREATE TABLE [dbo].[Post] ( - [id] INT NOT NULL IDENTITY(1,1), - [createdAt] DATETIME2 NOT NULL CONSTRAINT [Post_createdAt_df] DEFAULT CURRENT_TIMESTAMP, - [updatedAt] DATETIME2 NOT NULL, - [title] VARCHAR(255) NOT NULL, - [content] NVARCHAR(1000), - [published] BIT NOT NULL CONSTRAINT [Post_published_df] DEFAULT 0, - [authorId] INT NOT NULL, - CONSTRAINT [Post_pkey] PRIMARY KEY ([id]) -); - -CREATE TABLE [dbo].[Profile] ( - [id] INT NOT NULL IDENTITY(1,1), - [bio] NVARCHAR(1000), - [userId] INT NOT NULL, - CONSTRAINT [Profile_pkey] PRIMARY KEY ([id]), - CONSTRAINT [Profile_userId_key] UNIQUE ([userId]) -); - -CREATE TABLE [dbo].[User] ( - [id] INT NOT NULL IDENTITY(1,1), - [email] NVARCHAR(1000) NOT NULL, - [name] NVARCHAR(1000), - CONSTRAINT [User_pkey] PRIMARY KEY ([id]), - CONSTRAINT [User_email_key] UNIQUE ([email]) -); - -ALTER TABLE [dbo].[Post] ADD CONSTRAINT [Post_authorId_fkey] FOREIGN KEY ([authorId]) REFERENCES [dbo].[User]([id]) ON DELETE NO ACTION ON UPDATE CASCADE; - -ALTER TABLE [dbo].[Profile] ADD CONSTRAINT [Profile_userId_fkey] FOREIGN KEY ([userId]) REFERENCES [dbo].[User]([id]) ON DELETE NO ACTION ON UPDATE CASCADE; -``` - -
Expand for a graphical overview of the tables - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `NVARCHAR(1000)` | No | No | No | - | -| `email` | `NVARCHAR(1000)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `DATETIME2` | No | No | **✔️** | `now()` | -| `updatedAt` | `DATETIME2` | No | No | **✔️** | | -| `title` | `VARCHAR(255)` | No | No | **✔️** | - | -| `content` | `NVARCHAR(1000)` | No | No | No | - | -| `published` | `BIT` | No | No | **✔️** | `false` | -| `authorId` | `INT` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :--------------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `NVARCHAR(1000)` | No | No | No | - | -| `userId` | `INT` | No | **✔️** | **✔️** | - | - -
- -
- - - -For the purpose of this guide, we'll use a demo SQL schema with three tables: - -```sql no-lines -CREATE TABLE "User" ( - id INT8 PRIMARY KEY DEFAULT unique_rowid(), - name STRING(255), - email STRING(255) UNIQUE NOT NULL -); - -CREATE TABLE "Post" ( - id INT8 PRIMARY KEY DEFAULT unique_rowid(), - title STRING(255) UNIQUE NOT NULL, - "createdAt" TIMESTAMP NOT NULL DEFAULT now(), - content STRING, - published BOOLEAN NOT NULL DEFAULT false, - "authorId" INT8 NOT NULL, - FOREIGN KEY ("authorId") REFERENCES "User"(id) -); - -CREATE TABLE "Profile" ( - id INT8 PRIMARY KEY DEFAULT unique_rowid(), - bio STRING, - "userId" INT8 UNIQUE NOT NULL, - FOREIGN KEY ("userId") REFERENCES "User"(id) -); -``` - -> **Note**: Some fields are written in double quotes to ensure CockroachDB uses proper casing. If no double-quotes were used, CockroachDB would just read everything as _lowercase_ characters. - -
Expand for a graphical overview of the tables - -**User** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------ | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT8` | **✔️** | No | **✔️** | _autoincrementing_ | -| `name` | `STRING(255)` | No | No | No | - | -| `email` | `STRING(255)` | No | No | **✔️** | - | - -**Post** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------------ | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT8` | **✔️** | No | **✔️** | _autoincrementing_ | -| `createdAt` | `TIMESTAMP` | No | No | **✔️** | `now()` | -| `title` | `STRING(255)` | No | No | **✔️** | - | -| `content` | `STRING` | No | No | No | - | -| `published` | `BOOLEAN` | No | No | **✔️** | `false` | -| `authorId` | `INT8` | No | **✔️** | **✔️** | - | - -**Profile** - -| Column name | Type | Primary key | Foreign key | Required | Default | -| :---------- | :------- | :---------- | :---------- | :------- | :----------------- | -| `id` | `INT8` | **✔️** | No | **✔️** | _autoincrementing_ | -| `bio` | `STRING` | No | No | No | - | -| `userId` | `INT8` | No | **✔️** | **✔️** | - | - -
- -
- - - -As a next step, you will introspect your database. The result of the introspection will be a [data model](/orm/prisma-schema/data-model/models) inside your Prisma schema. - -Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a data model in your Prisma schema. - -After the introspection is complete, your Prisma schema file was updated: - -![Introspect your database with Prisma ORM](../../../../doc-images/prisma-db-pull-generate-schema.png) - -The data model now looks similar to this (note that the fields on the models have been reordered for better readability): - -```prisma file=prisma/schema.prisma -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - authorId Int - User User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - userId Int @unique - User User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model User { - id Int @id @default(autoincrement()) - name String? @db.VarChar(255) - email String @unique @db.VarChar(255) - Post Post[] - Profile Profile? -} -``` - -Prisma ORM's data model is a declarative representation of your database schema and serves as the foundation for the generated Prisma Client library. Your Prisma Client instance will expose queries that are _tailored_ to these models. - -Right now, there's a few minor "issues" with the data model: - -- The `User` relation field is uppercased and therefore doesn't adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) . To express more "semantics", it would also be nice if this field was called `author` to _describe_ the relationship between `User` and `Post` better. -- The `Post` and `Profile` relation fields on `User` as well as the `User` relation field on `Profile` are all uppercased. To adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) , both fields should be lowercased to `post`, `profile` and `user`. -- Even after lowercasing, the `post` field on `User` is still slightly misnamed. That's because it actually refers to a [list](/orm/prisma-schema/data-model/models#type-modifiers) of posts – a better name therefore would be the plural form: `posts`. - -These changes are relevant for the generated Prisma Client API where using lowercased relation fields `author`, `posts`, `profile` and `user` will feel more natural and idiomatic to JavaScript/TypeScript developers. You can therefore [configure your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names). - -Because [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) are _virtual_ (i.e. they _do not directly manifest in the database_), you can manually rename them in your Prisma schema without touching the database: - -```prisma file=prisma/schema.prisma highlight=8,15,22,23;edit -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - authorId Int - author User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - userId Int @unique - user User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model User { - id Int @id @default(autoincrement()) - name String? @db.VarChar(255) - email String @unique @db.VarChar(255) - posts Post[] - profile Profile? -} -``` - -In this example, the database schema did follow the [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions) for Prisma ORM models (only the virtual relation fields that were generated from introspection did not adhere to them and needed adjustment). This optimizes the ergonomics of the generated Prisma Client API. - -
- Using custom model and field names - -Sometimes though, you may want to make additional changes to the names of the columns and tables that are exposed in the Prisma Client API. A common example is to translate _snake_case_ notation which is often used in database schemas into _PascalCase_ and _camelCase_ notations which feel more natural for JavaScript/TypeScript developers. - -Assume you obtained the following model from introspection that's based on _snake_case_ notation: - -```prisma no-lines -model my_user { - user_id Int @id @default(autoincrement()) - first_name String? - last_name String @unique -} -``` - -If you generated a Prisma Client API for this model, it would pick up the _snake_case_ notation in its API: - -```ts no-lines -const user = await prisma.my_user.create({ - data: { - first_name: 'Alice', - last_name: 'Smith', - }, -}) -``` - -If you don't want to use the table and column names from your database in your Prisma Client API, you can configure them with [`@map` and `@@map`](/orm/prisma-schema/data-model/models#mapping-model-names-to-tables-or-collections): - -```prisma no-lines -model MyUser { - userId Int @id @default(autoincrement()) @map("user_id") - firstName String? @map("first_name") - lastName String @unique @map("last_name") - - @@map("my_user") -} -``` - -With this approach, you can name your model and its fields whatever you like and use the `@map` (for field names) and `@@map` (for models names) to point to the underlying tables and columns. Your Prisma Client API now looks as follows: - -```ts no-lines -const user = await prisma.myUser.create({ - data: { - firstName: 'Alice', - lastName: 'Smith', - }, -}) -``` - -Learn more about this on the [Configuring your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names) page. - -
- -
- - - -As a next step, you will introspect your database. The result of the introspection will be a [data model](/orm/prisma-schema/data-model/models) inside your Prisma schema. - -Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a data model in the Prisma schema. - -After the introspection is complete, your Prisma schema file was updated: - -![Introspect your database with Prisma](../../../../doc-images/prisma-db-pull-generate-schema.png) - -The data model now looks similar to this (note that the fields on the models have been reordered for better readability): - -```prisma file=prisma/schema.prisma -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(0) - content String? @db.Text - published Boolean @default(false) - authorId Int - User User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "Post_ibfk_1") - - @@index([authorId], map: "authorId") -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? @db.Text - userId Int @unique(map: "userId") - User User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "Profile_ibfk_1") -} - -model User { - id Int @id @default(autoincrement()) - name String? @db.VarChar(255) - email String @unique(map: "email") @db.VarChar(255) - Post Post[] - Profile Profile? -} -``` - - - -Refer to the [Prisma schema reference](/orm/reference/prisma-schema-reference) for detailed information about the schema definition. - - - -Prisma ORM's data model is a declarative representation of your database schema and serves as the foundation for the generated Prisma Client library. Your Prisma Client instance will expose queries that are _tailored_ to these models. - -Right now, there's a few minor "issues" with the data model: - -- The `User` relation field is uppercased and therefore doesn't adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) . To express more "semantics", it would also be nice if this field was called `author` to _describe_ the relationship between `User` and `Post` better. -- The `Post` and `Profile` relation fields on `User` as well as the `User` relation field on `Profile` are all uppercased. To adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) , both fields should be lowercased to `post`, `profile` and `user`. -- Even after lowercasing, the `post` field on `User` is still slightly misnamed. That's because it actually refers to a [list](/orm/prisma-schema/data-model/models#type-modifiers) of posts – a better name therefore would be the plural form: `posts`. - -These changes are relevant for the generated Prisma Client API where using lowercased relation fields `author`, `posts`, `profile` and `user` will feel more natural and idiomatic to JavaScript/TypeScript developers. You can therefore [configure your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names). - -Because [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) are _virtual_ (i.e. they _do not directly manifest in the database_), you can manually rename them in your Prisma schema without touching the database: - -```prisma file=prisma/schema.prisma highlight=8,17,24,25;edit -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(0) - content String? @db.Text - published Boolean @default(false) - authorId Int - author User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "Post_ibfk_1") - - @@index([authorId], map: "authorId") -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? @db.Text - userId Int @unique(map: "userId") - user User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "Profile_ibfk_1") -} - -model User { - id Int @id @default(autoincrement()) - name String? @db.VarChar(255) - email String @unique(map: "email") @db.VarChar(255) - posts Post[] - profile Profile? -} -``` - -In this example, the database schema did follow the [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions) for Prisma ORM models (only the virtual relation fields that were generated from introspection did not adhere to them and needed adjustment). This optimizes the ergonomics of the generated Prisma Client API. - -Sometimes though, you may want to make additional changes to the names of the columns and tables that are exposed in the Prisma Client API. A common example is to translate _snake_case_ notation which is often used in database schemas into _PascalCase_ and _camelCase_ notations which feel more natural for JavaScript/TypeScript developers. - -Assume you obtained the following model from introspection that's based on _snake_case_ notation: - -```prisma no-lines -model my_user { - user_id Int @id @default(autoincrement()) - first_name String? - last_name String @unique -} -``` - -If you generated a Prisma Client API for this model, it would pick up the _snake_case_ notation in its API: - -```ts no-lines -const user = await prisma.my_user.create({ - data: { - first_name: 'Alice', - last_name: 'Smith', - }, -}) -``` - -If you don't want to use the table and column names from your database in your Prisma Client API, you can configure them with [`@map` and `@@map`](/orm/prisma-schema/data-model/models#mapping-model-names-to-tables-or-collections): - -```prisma no-lines -model MyUser { - userId Int @id @default(autoincrement()) @map("user_id") - firstName String? @map("first_name") - lastName String @unique @map("last_name") - - @@map("my_user") -} -``` - -With this approach, you can name your model and its fields whatever you like and use the `@map` (for field names) and `@@map` (for models names) to point to the underlying tables and columns. Your Prisma Client API now looks as follows: - -```ts no-lines -const user = await prisma.myUser.create({ - data: { - firstName: 'Alice', - lastName: 'Smith', - }, -}) -``` - -Learn more about this on the [Configuring your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names) page. - - - - - -As a next step, you will introspect your database. The result of the introspection will be a [data model](/orm/prisma-schema/data-model/models) inside your Prisma schema. - -Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a data model in the Prisma schema. - -After the introspection is complete, your Prisma schema file was updated: - -![Introspect your database with Prisma](../../../../doc-images/prisma-db-pull-generate-schema.png) - -The data model now looks similar to this (note that the fields on the models have been reordered for better readability): - -```prisma file=prisma/schema.prisma -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - authorId Int - User User @relation(fields: [authorId], references: [id]) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - userId Int @unique - User User @relation(fields: [userId], references: [id]) -} - -model User { - id Int @id @default(autoincrement()) - name String? @db.VarChar(255) - email String @unique @db.VarChar(255) - Post Post[] - Profile Profile? -} -``` - -Prisma's data model is a declarative representation of your database schema and serves as the foundation for the generated Prisma Client library. Your Prisma Client instance will expose queries that are _tailored_ to these models. - -Right now, there's a few minor "issues" with the data model: - -- The `User` relation field is uppercased and therefore doesn't adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) . To express more "semantics", it would also be nice if this field was called `author` to _describe_ the relationship between `User` and `Post` better. -- The `Post` and `Profile` relation fields on `User` as well as the `User` relation field on `Profile` are all uppercased. To adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) , both fields should be lowercased to `post`, `profile` and `user`. -- Even after lowercasing, the `post` field on `User` is still slightly misnamed. That's because it actually refers to a [list](/orm/prisma-schema/data-model/models#type-modifiers) of posts – a better name therefore would be the plural form: `posts`. - -These changes are relevant for the generated Prisma Client API where using lowercased relation fields `author`, `posts`, `profile` and `user` will feel more natural and idiomatic to JavaScript/TypeScript developers. You can therefore [configure your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names). - -Because [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) are _virtual_ (i.e. they _do not directly manifest in the database_), you can manually rename them in your Prisma schema without touching the database: - -```prisma file=prisma/schema.prisma highlight=7,14,22,23;edit -model Post { - id Int @id @default(autoincrement()) - title String @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique -} - -model User { - id Int @id @default(autoincrement()) - email String @unique @db.VarChar(255) - name String? @db.VarChar(255) - posts Post[] - profile Profile? -} -``` - -In this example, the database schema did follow the [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions) for Prisma ORM models (only the virtual relation fields that were generated from introspection did not adhere to them and needed adjustment). This optimizes the ergonomics of the generated Prisma Client API. - -
- Using custom model and field names - -Sometimes though, you may want to make additional changes to the names of the columns and tables that are exposed in the Prisma Client API. A common example is to translate _snake_case_ notation which is often used in database schemas into _PascalCase_ and _camelCase_ notations which feel more natural for JavaScript/TypeScript developers. - -Assume you obtained the following model from introspection that's based on _snake_case_ notation: - -```prisma no-lines -model my_user { - user_id Int @id @default(autoincrement()) - first_name String? - last_name String @unique -} -``` - -If you generated a Prisma Client API for this model, it would pick up the _snake_case_ notation in its API: - -```ts no-lines -const user = await prisma.my_user.create({ - data: { - first_name: 'Alice', - last_name: 'Smith', - }, -}) -``` - -If you don't want to use the table and column names from your database in your Prisma Client API, you can configure them with [`@map` and `@@map`](/orm/prisma-schema/data-model/models#mapping-model-names-to-tables-or-collections): - -```prisma no-lines -model MyUser { - userId Int @id @default(autoincrement()) @map("user_id") - firstName String? @map("first_name") - lastName String @unique @map("last_name") - - @@map("my_user") -} -``` - -With this approach, you can name your model and its fields whatever you like and use the `@map` (for field names) and `@@map` (for models names) to point to the underlying tables and columns. Your Prisma Client API now looks as follows: - -```ts no-lines -const user = await prisma.myUser.create({ - data: { - firstName: 'Alice', - lastName: 'Smith', - }, -}) -``` - -Learn more about this on the [Configuring your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names) page. - -
- -
- - - -As a next step, you will introspect your database. The result of the introspection will be a [data model](/orm/prisma-schema/data-model/models) inside your Prisma schema. - -Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a data model in the Prisma schema. - -After the introspection is complete, your Prisma schema file was updated: - -![Introspect your database with Prisma](../../../../doc-images/prisma-db-pull-generate-schema.png) - -The data model now looks similar to this: - -```prisma file=prisma/schema.prisma -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime - title String @db.VarChar(255) - content String? - published Boolean @default(false) - authorId Int - - @@index([authorId]) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - userId Int @unique - - @@index([userId]) -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? -} -``` - - - -Refer to the [Prisma schema reference](/orm/reference/prisma-schema-reference) for detailed information about the schema definition. - - - -Prisma's data model is a declarative representation of your database schema and serves as the foundation for the generated Prisma Client library. Your Prisma Client instance will expose queries that are _tailored_ to these models. - -You will then need to add in any missing relations between your data using [relation fields](/orm/prisma-schema/data-model/relations#relation-fields): - -```prisma file=prisma/schema.prisma highlight=8,17,27,28;add -model Post { - id Int @id @default(autoincrement()) - createdAt DateTime @default(now()) - updatedAt DateTime - title String @db.VarChar(255) - content String? - published Boolean @default(false) - author User @relation(fields: [authorId], references: [id]) - authorId Int - - @@index([authorId]) -} - -model Profile { - id Int @id @default(autoincrement()) - bio String? - user User @relation(fields: [userId], references: [id]) - userId Int @unique - - @@index([userId]) -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? - posts Post[] - profile Profile? -} -``` - -After this, run introspection on your database for a second time: - -```terminal copy -npx prisma db pull -``` - -Prisma Migrate will now keep the manually added relation fields. - -Because relation fields are _virtual_ (i.e. they _do not directly manifest in the database_), you can manually rename them in your Prisma schema without touching the database. - -In this example, the database schema follows the [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions) for Prisma ORM models. This optimizes the ergonomics of the generated Prisma Client API. - -
- Using custom model and field names - -Sometimes though, you may want to make additional changes to the names of the columns and tables that are exposed in the Prisma Client API. A common example is to translate _snake_case_ notation which is often used in database schemas into _PascalCase_ and _camelCase_ notations which feel more natural for JavaScript/TypeScript developers. - -Assume you obtained the following model from introspection that's based on _snake_case_ notation: - -```prisma no-lines -model my_user { - user_id Int @id @default(autoincrement()) - first_name String? - last_name String @unique -} -``` - -If you generated a Prisma Client API for this model, it would pick up the _snake_case_ notation in its API: - -```ts no-lines -const user = await prisma.my_user.create({ - data: { - first_name: 'Alice', - last_name: 'Smith', - }, -}) -``` - -If you don't want to use the table and column names from your database in your Prisma Client API, you can configure them with [`@map` and `@@map`](/orm/prisma-schema/data-model/models#mapping-model-names-to-tables-or-collections): - -```prisma no-lines -model MyUser { - userId Int @id @default(autoincrement()) @map("user_id") - firstName String? @map("first_name") - lastName String @unique @map("last_name") - - @@map("my_user") -} -``` - -With this approach, you can name your model and its fields whatever you like and use the `@map` (for field names) and `@@map` (for models names) to point to the underlying tables and columns. Your Prisma Client API now looks as follows: - -```ts no-lines -const user = await prisma.myUser.create({ - data: { - firstName: 'Alice', - lastName: 'Smith', - }, -}) -``` - -Learn more about this on the [Configuring your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names) page. - -
- -
- - - -As a next step, you will introspect your database. The result of the introspection will be a [data model](/orm/prisma-schema/data-model/models) inside your Prisma schema. - -Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This commands reads the environment variable used to define the `url` in your `schema.prisma`, `DATABASE_URL`, that in our case is set in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a data model in the Prisma schema. - -After the introspection is complete, your Prisma schema file was updated: - -![Introspect your database with Prisma ORM](../../../../doc-images/prisma-db-pull-generate-schema.png) - -The data model now looks similar to this: - -```prisma file=prisma/schema.prisma -model Post { - id BigInt @id @default(autoincrement()) - title String @unique @db.String(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - authorId BigInt - User User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model Profile { - id BigInt @id @default(autoincrement()) - bio String? - userId BigInt @unique - User User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model User { - id BigInt @id @default(autoincrement()) - name String? @db.String(255) - email String @unique @db.String(255) - Post Post[] - Profile Profile? -} -``` - -Prisma ORM's data model is a declarative representation of your database schema and serves as the foundation for the generated Prisma Client library. Your Prisma Client instance will expose queries that are _tailored_ to these models. - -Right now, there's a few minor "issues" with the data model: - -- The `User` relation field is uppercased and therefore doesn't adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) . To express more "semantics", it would also be nice if this field was called `author` to _describe_ the relationship between `User` and `Post` better. -- The `Post` and `Profile` relation fields on `User` as well as the `User` relation field on `Profile` are all uppercased. To adhere to Prisma's [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions-1) , both fields should be lowercased to `post`, `profile` and `user`. -- Even after lowercasing, the `post` field on `User` is still slightly misnamed. That's because it actually refers to a [list](/orm/prisma-schema/data-model/models#type-modifiers) of posts – a better name therefore would be the plural form: `posts`. - -These changes are relevant for the generated Prisma Client API where using lowercased relation fields `author`, `posts`, `profile` and `user` will feel more natural and idiomatic to JavaScript/TypeScript developers. You can therefore [configure your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names). - -Because [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) are _virtual_ (i.e. they _do not directly manifest in the database_), you can manually rename them in your Prisma schema without touching the database: - -```prisma file=prisma/schema.prisma highlight=8,15,22,23;edit -model Post { - id BigInt @id @default(autoincrement()) - title String @unique @db.String(255) - createdAt DateTime @default(now()) @db.Timestamp(6) - content String? - published Boolean @default(false) - authorId BigInt - author User @relation(fields: [authorId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model Profile { - id BigInt @id @default(autoincrement()) - bio String? - userId BigInt @unique - user User @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -model User { - id BigInt @id @default(autoincrement()) - name String? @db.String(255) - email String @unique @db.String(255) - posts Post[] - profile Profile? -} -``` - -In this example, the database schema did follow the [naming conventions](/orm/reference/prisma-schema-reference#naming-conventions) for Prisma ORM models (only the virtual relation fields that were generated from introspection did not adhere to them and needed adjustment). This optimizes the ergonomics of the generated Prisma Client API. - -
- Using custom model and field names - -Sometimes though, you may want to make additional changes to the names of the columns and tables that are exposed in the Prisma Client API. A common example is to translate _snake_case_ notation which is often used in database schemas into _PascalCase_ and _camelCase_ notations which feel more natural for JavaScript/TypeScript developers. - -Assume you obtained the following model from introspection that's based on _snake_case_ notation: - -```prisma no-lines -model my_user { - user_id Int @id @default(sequence()) - first_name String? - last_name String @unique -} -``` - -If you generated a Prisma Client API for this model, it would pick up the _snake_case_ notation in its API: - -```ts no-lines -const user = await prisma.my_user.create({ - data: { - first_name: 'Alice', - last_name: 'Smith', - }, -}) -``` - -If you don't want to use the table and column names from your database in your Prisma Client API, you can configure them with [`@map` and `@@map`](/orm/prisma-schema/data-model/models#mapping-model-names-to-tables-or-collections): - -```prisma no-lines -model MyUser { - userId Int @id @default(sequence()) @map("user_id") - firstName String? @map("first_name") - lastName String @unique @map("last_name") - - @@map("my_user") -} -``` - -With this approach, you can name your model and its fields whatever you like and use the `@map` (for field names) and `@@map` (for models names) to point to the underlying tables and columns. Your Prisma Client API now looks as follows: - -```ts no-lines -const user = await prisma.myUser.create({ - data: { - firstName: 'Alice', - lastName: 'Smith', - }, -}) -``` - -Learn more about this on the [Configuring your Prisma Client API](/orm/prisma-client/setup-and-configuration/custom-model-and-field-names) page. - -
- -
- - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Install Prisma Client - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - - - - - - - - Connect your database - - - - Baseline your database - - - - - diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/index.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/index.mdx deleted file mode 100644 index 15847b80a3..0000000000 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/index.mdx +++ /dev/null @@ -1,276 +0,0 @@ ---- -title: 'Relational databases' -metaTitle: 'Add Prisma to an existing project that uses a relational database (15 min)' -metaDescription: 'Learn how to add Prisma to an existing Node.js or TypeScript project by connecting it to your relational database and generating a Prisma Client for database access.' -duration: '15 min' -toc: false -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['postgresql', 'mysql', 'sqlserver', 'planetscale', 'cockroachdb'] ---- - - - -Learn how to add Prisma ORM to an existing Node.js or TypeScript project by connecting it to your database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Introspection](/orm/prisma-schema/introspection). - - - - - -
- -If you're migrating to Prisma ORM from another ORM, see our [Migrate from TypeORM](/orm/more/migrating-to-prisma/migrate-from-typeorm) or [Migrate from Sequelize](/orm/more/migrating-to-prisma/migrate-from-sequelize) migration guides. - -
-
- -## Prerequisites - -In order to successfully complete this guide, you need: - - - -- an existing Node.js project with a `package.json` -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [PostgreSQL](https://www.postgresql.org/) database server running and a database with at least one table - - - - - -- an existing Node.js project with a `package.json` -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [MySQL](https://www.mysql.com/) database server running and a database with at least one table - - - - - -- an existing Node.js project with a `package.json` -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [PlanetScale](https://www.planetscale.com/) database server running and a database with at least one table - - - - - -- [Node.js](https://nodejs.org/en/) installed on your machine -- A [Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/?view=sql-server-ver15) database - - [Microsoft SQL Server on Linux for Docker](/orm/overview/databases/sql-server/sql-server-docker) - - [Microsoft SQL Server on Windows (local)](/orm/overview/databases/sql-server/sql-server-local) - - - - - -- an existing Node.js project with a `package.json` -- [Node.js](https://nodejs.org/en/) installed on your machine -- a [CockroachDB](https://www.cockroachlabs.com) database server running and a database with at least one table - - - -> See [System requirements](/orm/reference/system-requirements) for exact version requirements. - -Make sure you have your database [connection URL](/orm/reference/connection-urls) (that includes your authentication credentials) at hand! If you don't have a database server running and just want to explore Prisma ORM, check out the [Quickstart](/getting-started/quickstart). - -## Set up Prisma ORM - -As a first step, navigate into your project directory that contains the `package.json` file. - -Next, add the Prisma CLI as a development dependency to your project: - -```terminal copy -npm install prisma --save-dev -``` - -You can now invoke the Prisma CLI by prefixing it with `npx`: - -```terminal -npx prisma -``` - - - -See [installation instructions](/orm/tools/prisma-cli#installation) to learn how to install Prisma ORM using a different package manager. - - - -Next, set up your Prisma ORM project by creating your [Prisma schema](/orm/prisma-schema) file template with the following command: - -```terminal copy -npx prisma init -``` - -This command does two things: - -- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models -- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection.mdx deleted file mode 100644 index 9472d84e5e..0000000000 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection.mdx +++ /dev/null @@ -1,175 +0,0 @@ ---- -title: 'Introspection' -metaTitle: 'Introspection' -metaDescription: 'Introspection your database with Prisma' -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['mongodb'] -toc: false ---- - -# Introspection - -Prisma ORM introspects a MongoDB schema by sampling the data stored in the given database and inferring the schema of that data. - -For the purposes of illustrating introspection, this guide will help you setup a MongoDB from scratch. But if you have a MongoDB database already, feel free to jump to [Initializing Prisma ORM](#initializing-prisma-orm) in your project. - -## Setting up your Database - -To see this in action, first create a `blog` database with 2 collections: `User` and `Post`. We recommend [MongoDB Compass](https://www.mongodb.com/products/compass) for setting this up: - -![Create a blog database using Compass](./1-create-database.jpg) - -First, add a user to our `User` collection: - -![Create a user within the User collection](./2-create-user.jpg) - -Next, add some posts to our `Post` collection. It's important that the ObjectID in `userId` matches the user you created above. - -![Create some posts within the Post collection](./3-create-posts.jpg) - -## Initializing Prisma ORM - -Now that you have a MongoDB database, the next step is to create a new project and initialize Prisma ORM: - -```terminal copy -mkdir blog -cd blog -npm init -y -npm install -D prisma -npx prisma init -``` - -Initializing Prisma ORM will create a `prisma/schema.prisma` file. Edit this file to use MongoDB: - -```prisma file=prisma/schema.prisma -datasource db { - provider = "mongodb" - url = env("DATABASE_URL") -} - -generator client { - provider = "prisma-client-js" -} -``` - -Next you'll need to adjust your `.env` file to point the `DATABASE_URL` to your MongoDB database - -## Introspecting MongoDB with Prisma ORM - -You're now ready to introspect. Run the following command to introspect your database: - -```terminal copy -npx prisma db pull -``` - -This command introspects our database and writes the inferred schema into your `prisma/schema.prisma` file: - -```prisma file=prisma/schema.prisma -datasource db { - provider = "mongodb" - url = env("DATABASE_URL") -} - -generator client { - provider = "prisma-client-js" -} - -model Post { - id String @id @default(auto()) @map("_id") @db.ObjectId - title String - userId String @db.ObjectId -} - -model User { - id String @id @default(auto()) @map("_id") @db.ObjectId - email String -} -``` - -## Tweaking the Schema - -To be able to join data using Prisma Client, you can add the [`@relation`](/orm/reference/prisma-schema-reference#relation) attributes to our models: - -```prisma file=prisma/schema.prisma highlight=14;add|20;add -datasource db { - provider = "mongodb" - url = env("DATABASE_URL") -} - -generator client { - provider = "prisma-client-js" -} - -model Post { - id String @id @default(auto()) @map("_id") @db.ObjectId - title String - userId String @db.ObjectId - user User @relation(fields: [userId], references: [id]) -} - -model User { - id String @id @default(auto()) @map("_id") @db.ObjectId - email String - posts Post[] -} -``` - - - -We're actively working on MongoDB introspection. Provide feedback for this feature in [this issue](https://github.com/prisma/prisma/issues/8241). - - - -And with that, you're ready to generate Prisma Client. - - - - - - - Connect to your Database - - - - Install Prisma Client - - - - - - - - - - - - Connect to your Database - - - - Install Prisma Client - - - - - diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/index.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/index.mdx deleted file mode 100644 index 8a7a155ff5..0000000000 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/index.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: 'MongoDB' -metaTitle: 'Add Prisma to an existing MongoDB project (15 min)' -metaDescription: 'Learn how to add Prisma to an existing Node.js or TypeScript project by connecting it to your MongoDB database and generating a Prisma Client for database access.' -duration: '15 min' -toc: false -langSwitcher: ['typescript', 'node'] -dbSwitcher: ['mongodb'] ---- - - - -Learn how to add Prisma ORM to an existing Node.js or TypeScript project by connecting it to your database and generating a Prisma Client for database access. The following tutorial introduces you to [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Introspection](/orm/prisma-schema/introspection). - - - - - -
- -If you're migrating to Prisma ORM from Mongoose, see our [Migrate from Mongoose guide](/orm/more/migrating-to-prisma/migrate-from-mongoose). - -
-
- -## Prerequisites - -In order to successfully complete this guide, you need: - -- [Node.js](https://nodejs.org/en/) installed on your machine -- Access to a MongoDB 4.2+ server with a replica set deployment. We recommend using [MongoDB Atlas](https://www.mongodb.com/cloud/atlas). - - - - The MongoDB database connector uses transactions to support nested writes. Transactions **requires** a [replica set](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/) deployment. The easiest way to deploy a replica set is with [Atlas](https://docs.atlas.mongodb.com/getting-started/). It's free to get started. - - - -Make sure you have your database [connection URL](/orm/reference/connection-urls) (that includes your authentication credentials) at hand! If you don't have a database server running and just want to explore Prisma ORM, check out the [Quickstart](/getting-started/quickstart). - -> See [System requirements](/orm/reference/system-requirements) for exact version requirements. - -## Set up Prisma ORM - -As a first step, navigate into it your project directory that contains the `package.json` file. - -Next, add the Prisma CLI as a development dependency to your project: - -```terminal copy -npm install prisma --save-dev -``` - -You can now invoke the Prisma CLI by prefixing it with `npx`: - -```terminal -npx prisma -``` - -Next, set up your Prisma ORM project by creating your [Prisma schema](/orm/prisma-schema) file template with the following command: - -```terminal copy -npx prisma init -``` - -This command does two things: - -- creates a new directory called `prisma` that contains a file called `schema.prisma`, which contains the Prisma schema with your database connection variable and schema models -- creates the [`.env` file](/orm/more/development-environment/environment-variables/env-files) in the root directory of the project, which is used for defining environment variables (such as your database connection) - - - - - - - Connect your database - - - - - - - - - - - - Connect your database - - - - - diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx index 34aec3b7f5..5cd3622fe1 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx @@ -16,7 +16,7 @@ Netlify is a cloud platform for continuous deployment, static sites, and serverl Before you can follow this guide, you will need to set up your application to begin deploying to Netlify. We recommend the ["Get started with Netlify"](https://docs.netlify.com/get-started/) guide for a quick overview and ["Deploy functions"](https://docs.netlify.com/functions/deploy/?fn-language=ts) for an in-depth look at your deployment options. -## Binary targets in schema.prisma +## Binary targets in `schema.prisma` Since your code is being deployed to Netlify's environment, which isn't necessarily the same as your development environment, you will need to set [`binaryTargets`](/orm/reference/prisma-schema-reference#binarytargets-options) in order to download the query engine that is compatible with the Netlify runtime during your build step. If you do not set this option, your deployed code will have an incorrect query engine deployed with it and will not function. diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx index 35e69c8943..44af4ba904 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx @@ -50,13 +50,13 @@ When using your Worker in **development**, you can configure your database conne Assuming you use the `DATABASE_URL` environment variable from above, you can set it inside `.dev.vars` as follows: -```bash file=.dev.vars showLineNumbers +```bash file=.dev.vars DATABASE_URL="your-database-connection-string" ``` In the above snippet, `your-database-connection-string` is a placeholder that you need to replace with the value of your own connection string, for example: -```bash file=.dev.vars showLineNumbers +```bash file=.dev.vars DATABASE_URL="postgresql://admin:mypassword42@somehost.aws.com:5432/mydb" ``` @@ -71,7 +71,7 @@ There are several options for achieving this: dotenv -e .dev.vars -- npx prisma migrate dev ``` - Create a script in `package.json` that reads `.dev.vars` via [`dotenv`](https://www.npmjs.com/package/dotenv-cli). You can then execute `prisma` commands as follows: `npm run env -- npx prisma migrate dev`. Here's a reference for the script: - ```js file=package.json showLineNumbers + ```js file=package.json "scripts": { "env": "dotenv -e .dev.vars" } ``` - Duplicate the `DATABASE_URL` and any other relevant env vars into a new file called `.env` which can then be used by Prisma ORM. @@ -163,7 +163,7 @@ If you are running into a size issue and can't deploy your application because o First, ensure that the database connection is configured properly. In your Prisma schema, set the `url` of the `datasource` block to the `DATABASE_URL` environment variable. You also need to enable the `driverAdapters` feature flag: -```prisma file=schema.prisma showLineNumbers +```prisma file=schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["driverAdapters"] @@ -177,7 +177,7 @@ datasource db { Next, you need to set the `DATABASE_URL` environment variable to the value of your database connection string. You'll do this in a file called `.dev.vars` used by Cloudflare: -```bash file=.dev.vars showLineNumbers +```bash file=.dev.vars DATABASE_URL="postgresql://admin:mypassword42@somehost.aws.com:5432/mydb" ``` @@ -185,12 +185,11 @@ Because the Prisma CLI by default is only compatible with `.env` files, you can Add this script to your `package.json`: -```js file=package.json highlight=5;add showLineNumbers +```js file=package.json highlight=5;add { // ... "scripts": { // .... - //add-next-line "env": "dotenv -e .dev.vars" }, // ... @@ -217,7 +216,7 @@ npm install @types/pg --save-dev # if you're using TypeScript In your `wrangler.toml` file, add the following line: -```toml file=wrangler.toml showLineNumbers +```toml file=wrangler.toml node_compat = true ``` @@ -313,7 +312,7 @@ If you are using a PlanetScale database, you need to: First, ensure that the database connection is configured properly. In your Prisma schema, set the `url` of the `datasource` block to the `DATABASE_URL` environment variable. You also need to enable the `driverAdapters` feature flag: -```prisma file=schema.prisma showLineNumbers +```prisma file=schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["driverAdapters"] @@ -328,7 +327,7 @@ datasource db { Next, you need to set the `DATABASE_URL` environment variable to the value of your database connection string. You'll do this in a file called `.dev.vars` used by Cloudflare: -```bash file=.dev.vars showLineNumbers +```bash file=.dev.vars DATABASE_URL="mysql://32qxa2r7hfl3102wrccj:password@us-east.connect.psdb.cloud/demo-cf-worker-ps?sslaccept=strict" ``` @@ -336,12 +335,11 @@ Because the Prisma CLI by default is only compatible with `.env` files, you can Add this script to your `package.json`: -```js file=package.json highlight=5;add showLineNumbers +```js file=package.json highlight=5;add { // ... "scripts": { // .... - //add-next-line "env": "dotenv -e .dev.vars" }, // ... @@ -440,7 +438,7 @@ If you are using a Neon database, you need to: First, ensure that the database connection is configured properly. In your Prisma schema, set the `url` of the `datasource` block to the `DATABASE_URL` environment variable. You also need to enable the `driverAdapters` feature flag: -```prisma file=schema.prisma showLineNumbers +```prisma file=schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["driverAdapters"] @@ -454,7 +452,7 @@ datasource db { Next, you need to set the `DATABASE_URL` environment variable to the value of your database connection string. You'll do this in a file called `.dev.vars` used by Cloudflare: -```bash file=.dev.vars showLineNumbers +```bash file=.dev.vars DATABASE_URL="postgresql://janedoe:password@ep-nameless-pond-a23b1mdz.eu-central-1.aws.neon.tech/neondb?sslmode=require" ``` @@ -467,7 +465,6 @@ Add this script to your `package.json`: // ... "scripts": { // .... - //add-next-line "env": "dotenv -e .dev.vars" }, // ... diff --git a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/02-schema-incompatibilities.mdx b/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/02-schema-incompatibilities.mdx deleted file mode 100644 index 4244db5327..0000000000 --- a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/02-schema-incompatibilities.mdx +++ /dev/null @@ -1,854 +0,0 @@ ---- -title: 'Schema incompatibilities' -# metaTitle: 'Problems and workarounds for Prisma 1 and 2.x and later schemas' -# metaDescription: 'Learn about the schema incompatibilities between Prisma 1 and Prisma ORM versions 2 and later, and how to resolve them with several workarounds.' -dbSwitcher: ['postgresql', 'mysql'] -techMetaTitles: - [ - { name: 'mysql', value: 'Schema Incompatibilities | MySQL' }, - { name: 'postgresql', value: 'Schema Incompatibilities | PostgreSQL' }, - ] -techMetaDescriptions: - [ - { - name: 'mysql', - value: 'Problems and workarounds for Prisma 1 and 2.0 schemas with MySQL', - }, - { - name: 'postgresql', - value: 'Problems and workarounds for Prisma 1 and 2.0 schemas with PostgreSQL', - }, - ] ---- - -## Overview - -Each section on this page describes a potential problem when upgrading from Prisma 1 to Prisma ORM 2._x_ and later and explains the available workarounds. - -## Default values aren't represented in database - -### Problem - -When adding the `@default` directive in a Prisma 1 datamodel, the default values for this field are generated by the Prisma 1 server at runtime. There's no `DEFAULT` constraint added to the database column. Because this constraint is not reflected in the database itself, the Prisma ORM 2._x_ and later versions of introspection can't recognize it. - -### Example - -#### Prisma 1 datamodel - -```graphql -type Post { - id: ID! @id - published: Boolean @default(value: false) -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "Post" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - published BOOLEAN NOT NULL -); -``` - -#### Result of introspection in Prisma ORM versions 2._x_ and later - -```prisma file=schema.prisma -model Post { - id String @id - published Boolean -} -``` - -Because the `DEFAULT` constraint has not been added to the database when mapping the Prisma 1 datamodel to the database with `prisma deploy`, Prisma ORM v2 (and later versions) doesn't recognize it during introspection. - -### Workarounds - -#### Manually add a `DEFAULT` constraint to the database column - -You can alter the column to add the `DEFAULT` constraint as follows: - - - -```sql -ALTER TABLE "Post" - ALTER COLUMN published SET DEFAULT false; -``` - - - - - -```sql -ALTER TABLE `Post` - ALTER COLUMN published SET DEFAULT false; -``` - - - -After this adjustment, you can re-introspect your database and the `@default` attribute will be added to the `published` field: - -```prisma line-number file=schema.prisma highlight=3;normal -model Post { - id String @id - published Boolean @default(false) -} -``` - -#### Manually add a `@default` attribute to the Prisma model - -You can add the `@default` attribute to the Prisma model: - -```prisma line-number file=schema.prisma highlight=3;add -model Post { - id String - published Boolean @default(false) -} -``` - -If the `@default` attribute is set in the Prisma schema and you run `prisma generate`, the resulting Prisma Client code will generate the specified default values at runtime (similar to what the Prisma 1 server did in Prisma 1). - -## Generated CUIDs as ID values aren't represented in database - -### Problem - -Prisma 1 auto-generates ID values as CUIDs for `ID` fields when they're annotated with the `@id` directive. These CUIDs are generated by the Prisma 1 server at runtime. Because this behavior is not reflected in the database itself, the introspection in Prisma ORM 2._x_ and later can't recognize it. - -### Example - -#### Prisma 1 datamodel - -```graphql -type Post { - id: ID! @id -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "Post" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); -``` - -#### Result of introspection in Prisma ORM versions 2._x_ and later - -```prisma file=schema.prisma -model Post { - id String @id -} -``` - -Because there's no indication of the CUID behavior in the database, Prisma ORM's introspection doesn't recognize it. - -### Workaround - -As a workaround, you can manually add the `@default(cuid())` attribute to the Prisma model: - -```prisma line-number file=schema.prisma highlight=2;add -model Post { - id String @id @default(cuid()) -} -``` - -If the `@default` attribute is set in the Prisma schema and you run `prisma generate`, the resulting Prisma Client code will generate the specified default values at runtime (similar to what the Prisma 1 server did in Prisma 1). - -Note that you'll have to re-add the attribute after each introspection because introspection removes it (as the previous version of the Prisma schema is overwritten)! - -## `@createdAt` isn't represented in database - -### Problem - -Prisma 1 auto-generates values for `DateTime` fields when they're annotated with the `@createdAt` directive. These values are generated by the Prisma 1 server at runtime. Because this behavior is not reflected in the database itself, the introspection in Prisma ORM 2._x_ and later can't recognize it. - -### Example - -#### Prisma 1 datamodel - -```graphql line-number highlight=3;normal -type Post { - id: ID! @id - createdAt: DateTime! @createdAt -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "Post" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - "createdAt" TIMESTAMP NOT NULL -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model Post { - id String @id - createdAt DateTime -} -``` - -### Workarounds - -#### Manually add `DEFAULT CURRENT_TIMESTAMP` to the database column - -You can alter the column to add the `DEFAULT` constraint as follows: - -```sql -ALTER TABLE "Post" - ALTER COLUMN "createdAt" SET DEFAULT CURRENT_TIMESTAMP; -``` - -After this adjustment, you can re-introspect your database and the `@default` attribute will be added to the `createdAt` field: - -```prisma file=schema.prisma -model Post { - id String - createdAt DateTime @default(now()) -} -``` - -#### Manually add the `@default(now())` attribute to the Prisma model - -As a workaround, you can manually add the `@default(now())` attribute to the Prisma model: - -```prisma line-number file=schema.prisma highlight=3;normal -model Post { - id String @id - createdAt DateTime @default(now()) -} -``` - -If the `@default` attribute is set in the Prisma schema and you run `prisma generate`, the resulting Prisma Client code will generate the specified default values at runtime (similar to what the Prisma 1 server did in Prisma 1). - -Note that you'll have to re-add the attribute after each introspection because introspection removes it (as the previous version of the Prisma schema is overwritten)! - -## `@updatedAt` isn't represented in database - -### Problem - -Prisma 1 auto-generates values for `DateTime` fields when they're annotated with the `@updatedAt` directive. These values are generated by the Prisma 1 server at runtime. Because this behavior is not reflected in the database itself, the introspection in Prisma ORM 2._x_ and later can't recognize it.. - -### Example - -#### Prisma 1 datamodel - -```graphql -type Post { - id: ID! @id - updatedAt: DateTime! @updatedAt -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "Post" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - updatedAt TIMESTAMP -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model Post { - id String @id - updatedAt DateTime -} -``` - -### Workarounds - -#### Manually add the `@updatedAt` attribute to the Prisma model - -As a workaround, you can manually add the `@updatedAt` attribute to the Prisma model: - -```prisma line-number file=schema.prisma highlight=3;add -model Post { - id String @id - updatedAt DateTime @updatedAt -} -``` - -If the `@updatedAt` attribute is set in the Prisma schema and you run `prisma generate`, the resulting Prisma Client code will automatically generate values for this column when an existing record is updated (similar to what the Prisma 1 server did in Prisma 1). - -Note that you'll have to re-add the attribute after each introspection because introspection removes it (as the previous version of the Prisma schema is overwritten)! - -## Inline 1-1 relations are recognized as 1-n (missing `UNIQUE` constraint) - -### Problem - -In the [datamodel v1.1](https://www.prisma.io/blog/datamodel-v11-lrzqy1f56c90) that was introduced in Prisma ORM v1.31, 1-1 relations can be declared as _inline_. In that case, the relation will not be maintained via a [relation table](/orm/prisma-schema/data-model/relations/many-to-many-relations#relation-tables) but via a single foreign key on one of the two tables involved. - -When this approach is used, Prisma ORM doesn't add a `UNIQUE` constraint to the foreign key column which means that after introspection in Prisma ORM version 2._x_ and later, this former 1-1 relation will be added as a 1-n relation to the Prisma schema. - -### Example - -#### Prisma ORM datamodel v1.1 (available from Prisma ORM v1.31) - -```graphql -type User { - id: ID! @id - profile: Profile @relation(link: INLINE) -} - -type Profile { - id: ID! @id - user: User -} -``` - -Note that omitting the `@relation` directive in this case would result in the same behavior because `link: INLINE` is the _default_ for 1-1 relations. - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); - -CREATE TABLE "Profile" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - "user" VARCHAR(25), - FOREIGN KEY ("user") REFERENCES "User"(id) -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model User { - id String @id - Profile Profile[] -} - -model Profile { - id String @id - user String? - User User? @relation(fields: [user], references: [id]) -} -``` - -Because there's no `UNIQUE` constraint defined on the `user` column (which represents the foreign key in this relation), Prisma ORM's introspection recognizes the relation as 1-n. - -### Workaround - -#### Manually add `UNIQUE` constraint to the foreign key column - -You can alter the foreign key column to add the `UNIQUE` constraint as follows: - - - -```sql -ALTER TABLE "Profile" - ADD CONSTRAINT userId_unique UNIQUE ("user"); -``` - - - - - -```sql -ALTER TABLE `Profile` - ADD CONSTRAINT userId_unique UNIQUE (`user`); -``` - - - -After this adjustment, you can re-introspect your database and the 1-1 relation will be properly recognized: - -```prisma line-number file=schema.prisma highlight=3;normal -model User { - id String @id - Profile Profile? -} - -model Profile { - id String @id - user String? @unique - User User? @relation(fields: [user], references: [id]) -} -``` - -## _All_ non-inline relations are recognized as m-n - -### Problem - -Prisma 1 represents relations as relation tables most of the time: - -- All relations in the Prisma 1 **datamodel v1.0** are represented as relation tables -- In **datamodel v1.1**, all m-n relations as well as the 1-1 and 1-n relations declared as `link: TABLE` are represented as relation tables. - -Because of this representation, introspection in Prisma ORM version 2._x_ and later will recognize all these relations as m-n relations, even though they might have been declared as 1-1 or 1-n in Prisma 1. - -### Example - -#### Prisma 1 datamodel - -```graphql -type User { - id: ID! @id - posts: [Post!]! -} - -type Post { - id: ID! @id - author: User! @relation(link: TABLE) -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); - -CREATE TABLE "Post" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); - -CREATE TABLE "_PostToUser" ( - "A" VARCHAR(25) NOT NULL REFERENCES "Post"(id) ON DELETE CASCADE, - "B" VARCHAR(25) NOT NULL REFERENCES "User"(id) ON DELETE CASCADE -); -CREATE UNIQUE INDEX "_PostToUser_AB_unique" ON "_PostToUser"("A" text_ops,"B" text_ops); -CREATE INDEX "_PostToUser_B" ON "_PostToUser"("B" text_ops); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model User { - id String @id - Post Post[] @relation(references: [id]) -} - -model Post { - id String @id - User User[] @relation(references: [id]) -} -``` - -Because the relation table that was created by Prisma 1 uses the same [conventions for relation tables](/orm/prisma-schema/data-model/relations/many-to-many-relations#conventions-for-relation-tables-in-implicit-m-n-relations) as in Prisma ORM version 2._x_ and later, the relation now gets recognized as a m-n relation. - -### Workaround - -As a workaround, you can migrate the data into a structure that's compatible with Prisma ORM's 1-n relation: - - - -1. Create new column `authorId` on the `Post` table. This column should be a _foreign key_ that references the `id` field of the `User` table: - ```sql - ALTER TABLE "Post" ADD COLUMN "authorId" VARCHAR(25); - ALTER TABLE "Post" - ADD CONSTRAINT fk_author - FOREIGN KEY ("authorId") - REFERENCES "User"("id"); - ``` -1. Write a SQL query that reads all the rows from the `_PostToUser` relation table and for each row: - 1. Finds the respective `Post` record by looking up the value from column `A` - 1. Inserts the value from column `B` as the value for `authorId` into that `Post` record - ```sql - UPDATE "Post" post - SET "authorId" = post_to_user."B" - FROM "_PostToUser" post_to_user - WHERE post_to_user."A" = post."id"; - ``` -1. Delete the `_PostToUser` relation table - ```sql - DROP TABLE "_PostToUser"; - ``` - - - - - -1. Create new column `authorId` on the `Post` table. This column should be a _foreign key_ that references the `id` field of the `User` table: - ```sql - ALTER TABLE `Post` ADD COLUMN `authorId` VARCHAR(25); - ALTER TABLE `Post` ADD FOREIGN KEY (`authorId`) REFERENCES `User` (`id`); - ``` -1. Write a SQL query that reads all the rows from the `_PostToUser` relation table and for each row: - 1. Finds the respective `Post` record by looking up the value from column `A` - 1. Inserts the value from column `B` as the value for `authorId` into that `Post` record - ```sql - UPDATE Post, _PostToUser - SET Post.authorId = _PostToUser.B - WHERE Post.id = _PostToUser.A - ``` -1. Delete the `_PostToUser` relation table - ```sql - DROP TABLE `_PostToUser`; - ``` - - - -After that you can introspect your database and the relation will now be recognized as 1-n: - -```prisma line-number file=schema.prisma highlight=3,8,9;normal -model User { - id String @id - Post Post[] -} - -model Post { - id String @id - User User @relation(fields: [authorId], references: [id]) - authorId String -} -``` - -## `Json` type is represented as `TEXT` in database - -### Problem - -Prisma 1 supports the `Json` data type in its datamodel. However, in the underlying database, fields of type `Json` are actually stored as plain strings using the `TEXT` data type of the underlying database. Any parsing and validation of the stored JSON data is done by the Prisma 1 server at runtime. - -### Example - -#### Prisma 1 datamodel - -```graphql -type User { - id: ID! @id - jsonData: Json -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - jsonData TEXT -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model User { - id String @id - jsonData String? -} -``` - -### Workaround - -You can manually change the type of the column to `JSON` - - - -```sql -ALTER TABLE "User" ALTER COLUMN "jsonData" TYPE JSON USING "jsonData"::json; -``` - - - - - -```sql -ALTER TABLE User MODIFY COLUMN jsonData JSON; -``` - - - -After this adjustment, you can re-introspect your database and the field will now be recognized as `Json`: - -```prisma line-number file=schema.prisma highlight=3;normal -model User { - id String @id - jsonData Json? -} -``` - -## Enums are represented as `TEXT` in database - -### Problem - -Prisma 1 supports the `enum` data type in its datamodel. However, in the underlying database, types declared as `enum` are actually stored as plain strings using the `TEXT` data type of the underlying database. Any validation of the stored `enum` data is done by the Prisma 1 server at runtime. - -### Example - -#### Prisma 1 datamodel - -```graphql -type User { - id: ID! @id - role: Role -} - -enum Role { - ADMIN - CUSTOMER -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL, - role TEXT -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model User { - id String @id - role String? -} -``` - -### Workaround - -You can manually turn the `role` column into an enum with your desired values: - -1. Create an `enum` in your database that mirrors the `enum` you defined in the Prisma 1 datamodel: - ```sql - CREATE TYPE "Role" AS ENUM ('CUSTOMER', 'ADMIN'); - ``` -1. Change the type from `TEXT` to your new `enum`: - ```sql - ALTER TABLE "User" ALTER COLUMN "role" TYPE "Role" - USING "role"::text::"Role"; - ``` - -After introspection, the type is now properly recognized as an enum: - -```prisma line-number file=schema.prisma highlight=3,6-9;normal -model User { - id String @id - role Role? -} - -enum Role { - ADMIN - CUSTOMER -} -``` - -## Mismatching CUID length - -### Problem - -Prisma 1 uses CUIDs as ID values for all database records. In the underlying database, these IDs are represented as strings with a maximum size of 25 characters (as `VARCHAR(25)`). However, when configuring default CUIDs in your Prisma ORM 2._x_ (or later versions) schema with `@default(cuid())` the generated ID values might exceed the limit of 25 characters (the maximum length might be 30 characters). To make your IDs proof for Prisma ORM 2._x_ (or later versions), you therefore need to adjust the column type to `VARCHAR(30)`. - -### Example - -#### Prisma 1 datamodel - -```graphql -type User { - id: ID! @id -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); -``` - -#### Result of introspection in Prisma ORM 2._x_ and later versions - -```prisma file=schema.prisma -model User { - id String @id -} -``` - -### Workaround - -You can manually turn the `VARCHAR(25)` columns into `VARCHAR(30)`: - - - -```sql -ALTER TABLE "User" ALTER COLUMN "id" SET DATA TYPE character varying(30); -``` - - - - - -```sql -SET FOREIGN_KEY_CHECKS=0; -ALTER TABLE `User` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; -SET FOREIGN_KEY_CHECKS=1; -``` - - - -> **Note**: When fixing this issue with the [Upgrade CLI](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#prisma-1-upgrade-cli), the generated SQL statements will keep appearing in the Upgrade CLI even after you have changed the column types in the underlying database. This is a currently a limitation in the Upgrade CLI. - -## Scalar lists (arrays) are maintained with extra table - -### Problem - -In Prisma 1, you can define lists of _scalar_ types on your models. Under the hood, this is implemented with an extra table that keeps track of the values in the list. - -To remove the approach with the extra table which incurred hidden performance costs, Prisma ORM 2._x_ and later versions only support scalar lists only when they're natively supported by the database you use. At the moment, only [PostgreSQL supports scalar lists (arrays) natively](https://www.postgresql.org/docs/9.1/arrays.html). - -With PostgreSQL, you therefore can keep using scalar lists in Prisma ORM 2._x_ and later versions, but you'll need to perform a data migration to transfer the data from the extra table from Prisma 1 into an actual PostgreSQL array. - -### Example - -#### Prisma 1 datamodel - -```graphql -type User { - id: ID! @id - coinflips: [Boolean!]! @scalarList(strategy: RELATION) -} -``` - -#### Prisma 1 generated SQL migration - -```sql -CREATE TABLE "User" ( - id VARCHAR(25) PRIMARY KEY NOT NULL -); - -CREATE TABLE "User_coinflips" ( - "nodeId" VARCHAR(25) REFERENCES "User"(id), - position INTEGER, - value BOOLEAN NOT NULL, - CONSTRAINT "User_coinflips_pkey" PRIMARY KEY ("nodeId", position) -); -CREATE UNIQUE INDEX "User_coinflips_pkey" ON "User_coinflips"("nodeId" text_ops,position int4_ops); -``` - -#### Result of Prisma ORM 2 introspection - -```prisma file=schema.prisma -model User { - id String @id - User_coinflips User_coinflips[] -} - -model User_coinflips { - nodeId String - position Int - value Boolean - User User @relation(fields: [nodeId], references: [id]) - - @@id([nodeId, position]) -} -``` - -Note that you can now generate Prisma Client and you'll be able to access the data from the scalar lists through the extra table. PostgreSQL users can alternatively migrate the data into a native PostgreSQL array and continue to benefit from the slicker Prisma Client API for scalar lists (read the section below for more info). - -
Expand for sample Prisma Client API calls - -To access the coinflips data, you will now have to always [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) it in your queries: - -```ts -const user = await prisma.user.findUnique({ - where: { id: 1 }, - include: { - coinflips: { - orderBy: { position: 'asc' }, - }, - }, -}) -``` - -> **Note**: The `orderBy` is important to retain the order of the list. - -This is the `result of the query: - -```js -{ - id: 1, - name: 'Alice', - coinflips: [ - { id: 1, position: 1000, value: false }, - { id: 2, position: 2000, value: true }, - { id: 3, position: 3000, value: false }, - { id: 4, position: 4000, value: true }, - { id: 5, position: 5000, value: true }, - { id: 6, position: 6000, value: false } - ] -} -``` - -To access just the boolean values from the list, you can `map` over the `coinflips` on `user` as follows: - -```ts -const currentCoinflips = user!.coinflips.map((cf) => cf.value) -``` - -> **Note**: The exclamation mark above means that you're _force unwrapping_ the `user` value. This is necessary because the `user` returned from the previous query might be `null`. - -Here's the value of `currentCoinflips` after the call to `map`: - -```json5 -[false, true, false, true, true, false] -``` - -
- -### Workaround - -The following workaround is only available for PostgreSQL users! - -As scalar lists (i.e. [arrays](https://www.postgresql.org/docs/9.1/arrays.html)) are available as a native PostgreSQL feature, you can keep using the same notation of `coinflips: Boolean[]` in your Prisma schema. - -However, in order to do so you need to manually migrate the underlying data from the `User_coinflips` table into a PostgreSQL array. Here's how you can do that: - -1. Add the new `coinflips` column to the `User` tables: - ```sql - ALTER TABLE "User" ADD COLUMN coinflips BOOLEAN[]; - ``` -1. Migrate the data from `"User_coinflips".value` to `"User.coinflips"`: - ```sql - UPDATE "User" - SET coinflips = t.flips - FROM ( - SELECT "nodeId", array_agg(VALUE ORDER BY position) AS flips - FROM "User_coinflips" - GROUP BY "nodeId" - ) t - where t."nodeId" = "User"."id"; - ``` -1. To cleanup, you can delete the `User_coinflips` table: - ```sql - DROP TABLE "User_coinflips"; - ``` - -You can now introspect your database and the `coinflips` field will be represented as an array in your new Prisma schema: - -```prisma file=schema.prisma -model User { - id String @id - coinflips Boolean[] -} -``` - -You can keep using Prisma Client as before: - -```ts -const user = await prisma.user.findUnique({ - where: { id: 1 }, -}) -``` - -This is the result from the API call: - -```js -{ - id: 1, - name: 'Alice', - coinflips: [ false, true, false, true, true, false ] -} -``` diff --git a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx b/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx deleted file mode 100644 index 6cc73c0b45..0000000000 --- a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx +++ /dev/null @@ -1,1608 +0,0 @@ ---- -title: 'Upgrading the Prisma ORM layer' -# metaTitle: 'Upgrading the Prisma ORM layer to Prisma ORM 2' -# metaDescription: 'Learn how to upgrade the Prisma ORM layer to Prisma ORM 2 and create your Prisma schema.' -dbSwitcher: ['postgresql', 'mysql'] -techMetaTitles: - [ - { - name: 'mysql', - value: 'Upgrading the Prisma ORM layer to Prisma ORM 2 | MySQL', - }, - { - name: 'postgresql', - value: 'Upgrading the Prisma ORM layer to Prisma ORM 2 | PostgreSQL', - }, - ] -techMetaDescriptions: - [ - { - name: 'mysql', - value: 'Learn how to upgrade the Prisma ORM layer to Prisma ORM 2 and create your Prisma schema with MySQL', - }, - { - name: 'postgresql', - value: 'Learn how to upgrade the Prisma ORM layer to Prisma ORM 2 and create your Prisma schema with PostgreSQL', - }, - ] ---- - -## Overview - -This page explains the first step of your upgrade process: Taking your Prisma 1 configuration and upgrading it to Prisma ORM 2. Concretely, you will learn how to: - -1. Add the Prisma ORM 2 CLI as a development dependency -1. Create your Prisma ORM 2 schema -1. Determine your connection URL and connect to your database -1. Introspect your database (that was so far managed with Prisma 1) -1. Use the [Prisma 1 Upgrade CLI](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#prisma-1-upgrade-cli) to resolve the [schema incompatibilities](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql) in the new Prisma ORM 2 data model -1. Install and generate Prisma Client - -Once done with these steps, you can move on to the next guide that explains how you can upgrade the application layer to use Prisma Client for your database queries. - -> **Note**: During the upgrade process it can be helpful to get a graphical view on your database. It is therefore recommended to use a graphical database client to connect to your database, such as [TablePlus](https://tableplus.com/) or [Postico](https://eggerapps.at/postico/). - -## 1. Install Prisma ORM 2 CLI - -The Prisma ORM 2 CLI is available as the [`prisma`](https://www.npmjs.com/package/prisma) package on npm and is invoked via the `prisma` command. - -Note that the former `prisma` command for Prisma 1 has been renamed to `prisma1`. You can learn more about this [here](https://www.prisma.io/blog/prisma-2-beta-b7bcl0gd8d8e#renaming-the-prisma2-cli). - -You can install the Prisma ORM 2 CLI in your Node.js project as follows (be sure to invoke this command in the directory where your `package.json` is located): - -```terminal copy -npm install prisma --save-dev -``` - -> **Note**: With Prisma 1, it was usually recommended to install the CLI globally. We now recommend to [install the Prisma CLI locally](/orm/tools/prisma-cli#installation) to prevent version conflicts. - -You can now use the local installation of the `prisma` CLI by prefixing it with `npx`: - -```terminal -npx prisma -``` - -If you're upgrading your entire project [all at once](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#upgrade-strategies), you can now also uninstall the Prisma 1 CLI (otherwise expand below): - -```terminal -# remove global installation -npm uninstall -g prisma1 - -# remove local installation -npm uninstall prisma1 -``` - -
-
Expand if you want to keep using your Prisma 1 CLI side-by-side - -If you want to keep using the Prisma 1 CLI, it is recommend to remove your global installation of it and add the `prisma1` CLI as a development dependency: - -```terminal -# installs v1.34 of the Prisma 1 CLI -npm uninstall -g prisma -npm install prisma1 --save-dev -``` - -You can now invoke it as follows: - -```terminal -npx prisma1 -``` - -Note that if you need a CLI version smaller than 1.34 (e.g. 1.30), you can install it as follows: - -```terminal -# installs v1.30 of the Prisma 1 CLI -npm uninstall -g prisma@1.30 -npm install prisma@1.30 --save-dev -``` - -You can now invoke it as follows: - -```terminal -npx prisma -``` - -
- -## 2. Create your Prisma ORM 2 schema - -For this guide, you'll first create a new Prisma schema using the `prisma init` command and then "fill" it with a data model using [introspection](/orm/prisma-schema/introspection). - -Run the following command to create your Prisma schema (note that this throws an error if you already have a folder called `prisma`): - -```terminal copy -npx prisma init -``` - -If you're seeing the following error, you need to rename your current `prisma` directory: - -```no-lines -ERROR A folder called prisma already exists in your project. - Please try again in a project that is not yet using Prisma. -``` - -You can rename the current `prisma` directory to `prisma1` to make it clear that this holds the former Prisma 1 configuration: - -```terminal copy -mv prisma prisma1 -``` - -Now you can run `init` and it will succeed: - -```terminal copy -npx prisma init -``` - -It should print the following output: - -```no-lines wrap -✔ Your Prisma schema was created at prisma/schema.prisma. - You can now open it in your favorite editor. - -Next steps: -1. Set the `DATABASE_URL` in the `.env` file to point to your existing database. If your database has no tables yet, read https://pris.ly/d/getting-started -2. Set the `provider` of your `datasource` block in `schema.prisma` to match your database: `postgresql`, `mysql` or `sqlite`. -3. Run `prisma db pull` to introspect your database schema and update the Prisma schema data models accordingly. -4. Run `prisma generate` to install Prisma Client. You can then start querying your database. - -More information in our documentation: -https://pris.ly/d/getting-started -``` - -The command created a new folder called `prisma`, and two files: - -- `prisma/schema.prisma`: Your Prisma schema file that specifies the [data source](/orm/prisma-schema/overview/data-sources), [generator](/orm/prisma-schema/overview/generators) and [data model](/orm/prisma-schema/data-model/models) (note that the data model doesn't exist yet, it will be generated via introspection). -- `.env`: A [dotenv](https://github.com/motdotla/dotenv#readme) file to configure your database [connection URL](/orm/reference/connection-urls). - -Your initial Prisma schema looks as follows: - -```prisma file=schema.prisma -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -generator client { - provider = "prisma-client-js" -} -``` - -With Prisma 1, you specify which language variant of Prisma Client you wanted to use in your `prisma.yml`. With Prisma ORM 2, this information is now specified inside the Prisma schema via a `generator` block. - -> **Note**: Unlike Prisma 1, the TypeScript and JavaScript variants of Prisma Client 2.0 use the _same_ generator called `prisma-client-js`. The generated types in `index.d.ts` are _always_ included, even in plain JavaScript projects. This enables feature like autocompletion in VS Code even when not using TypeScript. - -## 3. Determine your connection URL and connect to your database - -With Prisma 1, the database connection is configured in the Docker Compose file that's used to launch the Prisma ORM server. The Prisma ORM server then exposes a GraphQL endpoint (via HTTP) that proxies all database requests from the Prisma Client application code. That HTTP endpoint is specified in your `prisma.yml`. - -With Prisma ORM 2, the HTTP layer isn't exposed any more and Prisma Client 2.0 is configured to run requests "directly" against the database (that is, requests are proxied by Prisma ORM's [query engine](/orm/more/under-the-hood/engines), but there isn't an extra server any more). - -So, as a next step you'll need to tell Prisma ORM 2 _what_ kind of database you use (MySQL or PostgreSQL) and _where_ it is located. - -First, you need to ensure that that `provider` field on the `datasource` block inside `schema.prisma` is configured to use the right database: - -- If you're using PostgreSQL, it needs to define the value `"postgresql"` in the `provider` field. -- If you're using MySQL, it needs to define the value `"mysql"` in the `provider` field. - -Switch around with the tabs in the code block to see examples of both: - - - -```prisma -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} -``` - -```prisma -datasource db { - provider = "mysql" - url = env("DATABASE_URL") -} -``` - - - -With the `provider` field set, you can go ahead and configure the connection URL inside the `.env` file. - -Assume the database configuration in your Docker Compose file that you used to deploy your Prisma ORM server looks as follows: - - - -```yml file=docker-compose.yml -PRISMA_CONFIG: | - port: 4466 - databases: - default: - connector: postgres - host: postgres - port: 5432 - user: prisma - password: prisma -``` - -Also assume your `endpoint` in `prisma.yml` is configured as follows: - -```yml file=prisma.yml -endpoint: http://localhost:4466/myproject/dev -``` - -Based on these connection details, you need to configure the `DATABASE_URL` environment variable inside your `.env` file as follows: - -```bash file=.env -DATABASE_URL="postgresql://janedoe:randompassword@localhost:5432/prisma?schema=myproject$dev" -``` - -Note that the `schema` argument is typically composed of your _service name_ and _service stage_ (which are part of the `endpoint` in `prisma.yml`), separated by the `$` character. - -Sometimes no service name and stage are specified in `prisma.yml`: - -```yml file=prisma.yml -endpoint: http://localhost:4466/ -``` - -In that case, the `schema` must be specified as follows: - -```bash file=.env -DATABASE_URL="postgresql://janedoe:randompassword@localhost:5432/prisma?schema=default$default" -``` - - - - - -```yml file=docker-compose.yml -PRISMA_CONFIG: | - port: 4466 - databases: - default: - connector: mysql - host: mysql - port: 3306 - user: root - password: randompassword -``` - -Also assume your `endpoint` in `prisma.yml` is configured as follows: - -```yml file=prisma.yml -endpoint: http://localhost:4466/myproject/dev -``` - -Based on these connection details, you need to configure the `DATABASE_URL` environment variable inside your `.env` file as follows: - -```bash file=.env -DATABASE_URL="mysql://root:randompassword@localhost:3306/myproject@dev" -``` - -Note that the _database name_ in the connection URL is typically composed of your _service name_ and _service stage_ (which are part of the `endpoint` in `prisma.yml`), separated by the `@` character. - -Sometimes no service name and stage are specified in `prisma.yml`: - -```yml file=prisma.yml -endpoint: http://localhost:4466/ -``` - -In that case, the database name must be specified as follows: - -```bash file=.env -DATABASE_URL="mysql://root:randompassword@localhost:3306/default@default" -``` - - - -Learn more on the [Connection URLs](/orm/reference/connection-urls) page. - -## 4. Introspect your database - -For the purpose of this guide, we'll use the following Prisma 1 data model (select the **SQL** tab below to see what the data model maps to in SQL): - - - -```graphql -type User { - id: ID! @id - email: String @unique - name: String! - role: Role! @default(value: CUSTOMER) - jsonData: Json - profile: Profile - posts: [Post!]! -} - -type Post { - id: ID! @id - createdAt: DateTime! @createdAt - updatedAt: DateTime! @updatedAt - title: String! - content: String - published: Boolean! @default(value: false) - author: User @relation(link: TABLE) - categories: [Category!]! -} - -type Profile { - id: ID! @id - bio: String - user: User! @relation(link: INLINE) -} - -type Category { - id: ID! @id - name: String! - posts: [Post!]! -} - -enum Role { - ADMIN - CUSTOMER -} -``` - -```sql -CREATE TABLE"User" ( - id character varying(25) PRIMARY KEY, - email text, - name text NOT NULL, - role text NOT NULL, - "jsonData" text -); -CREATE UNIQUE INDEX "User_pkey" ON"User"(id text_ops); -CREATE UNIQUE INDEX "default$default.User.email._UNIQUE" ON"User"(email text_ops); - -CREATE TABLE"Post" ( - id character varying(25) PRIMARY KEY, - title text NOT NULL, - published boolean NOT NULL, - "createdAt" timestamp(3) without time zone NOT NULL, - "updatedAt" timestamp(3) without time zone NOT NULL, - content text -); -CREATE UNIQUE INDEX "Post_pkey" ON"Post"(id text_ops); - -CREATE TABLE"Profile" ( - id character varying(25) PRIMARY KEY, - bio text, - user character varying(25) REFERENCES"User"(id) ON DELETE SET NULL -); -CREATE UNIQUE INDEX "Profile_pkey" ON"Profile"(id text_ops); - -CREATE TABLE"Category" ( - id character varying(25) PRIMARY KEY, - name text NOT NULL -); -CREATE UNIQUE INDEX "Category_pkey" ON"Category"(id text_ops); - -CREATE TABLE"_PostToUser" ( - "A" character varying(25) NOT NULL REFERENCES"Post"(id) ON DELETE CASCADE, - "B" character varying(25) NOT NULL REFERENCES"User"(id) ON DELETE CASCADE -); -CREATE UNIQUE INDEX "_PostToUser_AB_unique" ON"_PostToUser"("A" text_ops,"B" text_ops); -CREATE INDEX "_PostToUser_B" ON"_PostToUser"("B" text_ops); - -CREATE TABLE"_CategoryToPost" ( - "A" character varying(25) NOT NULL REFERENCES"Category"(id) ON DELETE CASCADE, - "B" character varying(25) NOT NULL REFERENCES"Post"(id) ON DELETE CASCADE -); -CREATE UNIQUE INDEX "_CategoryToPost_AB_unique" ON"_CategoryToPost"("A" text_ops,"B" text_ops); -CREATE INDEX "_CategoryToPost_B" ON"_CategoryToPost"("B" text_ops); -``` - - - -Note that this data model has three [relations](/orm/prisma-schema/data-model/relations): - -- 1-1: `User` ↔ `Profile` -- 1-n: `User` ↔ `Post` (maintained via the `_PostToUser` relation table) -- m-n: `Post` ↔ `Category` (maintained via the `_CategoryToPost` relation table) - -Now you can run Prisma ORM's introspection against your database with the following command: - -```terminal copy -npx prisma db pull -``` - -Here's a graphical illustration for what happens when `db pull` is invoked: - -![Introspect your database with Prisma ORM](../../../../doc-images/prisma-db-pull-generate-schema.png) - -For the above Prisma 1 datamodel, this results in the following Prisma ORM 2 schema (note that the models have been reordered to match the initial order of the Prisma 1 datamodel): - -```prisma file=schema.prisma -model User { - id String @id @default(cuid()) - email String? @unique - name String - role String - jsonData String? - Profile Profile[] - Post Post[] -} - -model Post { - id String @id @default(cuid()) - createdAt DateTime - updatedAt DateTime - title String - content String? - published Boolean - Category Category[] - User User[] -} - -model Profile { - id String @id @default(cuid()) - bio String? - user String? @unique - User User? @relation(fields: [user], references: [id]) -} - -model Category { - id String @id @default(cuid()) - name String - Post Post[] -} -``` - -While this is already a valid Prisma ORM 2 schema, it lacks a number of _features_ that were part of its Prisma 1 equivalent: - -- no auto-generated date values for the `createdAt` and `updatedAt` fields on `Post` -- no default value for the `role` field on `User` -- no default value for the `published` field on `Post` - -There further are a number of inconsistencies which result in a less idiomatic/ergonomic Prisma Client API: - -- `User` ↔ `Profile` is a 1-n instead of 1-1 relation -- `User` ↔ `Post` is a m-n instead of 1-n relation -- relation fields are uppercased (e.g. `Profile` and `Post` on `User`) -- the `jsonData` field on `User` is of type `String` instead of `Json` -- the `role` field on `User` is of type `String` instead of `Role`, the `enum` definition for role is missing altogether - -While these inconsistencies don't actually impact the "feature set" you'll have available in your Prisma Client API, they make you lose certain constraints/guarantees that were present before. - -For example, Prisma ORM now won't guarantee that a `User` is connected to _at most_ one `Profile` because the relation between the tables was recognized as 1-n during introspection, so one `User` record _could_ now get connected to multiple `Profile` records. - -Another issue is that you can store whatever text for the `jsonData` and `role` fields, regardless of whether it's valid JSON or represents a value of the `Role` enum. - -To learn more about these inconsistencies check out the [Schema incompatibilities](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql) page. - -In the following, we'll go through these incompatibilities and fix them one by one using the Prisma schema upgrade CLI. - -## 5. Use the Prisma schema upgrade CLI to resolve schema incompatibilities - -The [Prisma 1 Upgrade CLI](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#prisma-1-upgrade-cli) is an interactive tool that helps you upgrading your Prisma schema and ironing out most of the inconsistencies listed above. - -The Prisma 1 Upgrade CLI works in two major phases: - -1. Fix the database schema via plain SQL -1. Add missing attributes to the Prisma ORM 2 schema and other schema fixes - -During the first phase, it will generate and print a number of SQL statements that you should run against your database to adjust the database schema. You can either run all of the statements or a subset of them before continuing to the second phase. - -During the second phase, you don't need to do anything manually. The Upgrade CLI will make changes to your Prisma schema by adding certain Prisma ORM-level attributes (like `@default(cuid))` or `@updatedAt`), adjusting the names of relation fields to match the ones from your Prisma 1 datamodel and ensure 1-1-relations that were required on both sides in your Prisma 1 datamodel are also required in the Prisma ORM 2 schema. - -Note that **you can start over at any time during the process** and go back from the second to the first phase. - -In this illustration, the green area shows the first phase, the blue area shows the second phase. Note that you can optionally run `prisma db pull` in between the phases to update your Prisma schema data models: - -![Fixing the schema incompatibilities](images/fix-schema-incompatibilities.png) - -To use the Upgrade CLI, you can either install it locally in your project, or invoke it once without installation using `npx` as done here: - -```terminal copy -npx prisma-upgrade prisma1/prisma.yml prisma/schema.prisma -``` - -The CLI will greet you with the following message: - -```no-lines wrap -◮ Welcome to the interactive Prisma Upgrade CLI that helps with the -upgrade process from Prisma 1 to Prisma ORM 2. - -Please read the docs to learn more about the upgrade process: -https://pris.ly/d/how-to-upgrade - -➤ Goal -The Upgrade CLI helps you resolve the schema incompatibilities -between Prisma 1 and Prisma ORM 2. Learn more in the docs: -https://pris.ly/d/schema-incompatibilities - -➤ How it works -Throughout the process, you'll need to adjust your database schema by sending -SQL statements to it. The SQL statements are provided by the Upgrade CLI. - -Note that the Upgrade CLI never makes changes to your database, -you are in full control over any operations that are executed against it. - -You can stop and re-run the Upgrade CLI at any time. - -These are the different steps of the upgrade process: - - 1. The Upgrade CLI generates SQL commands for you to run on your database. - 2. You run the SQL commands against your database. - 3. You run the `npx prisma db pull` command again. - 4. You run the `npx prisma-upgrade` command again. - 5. The Upgrade CLI adjusts the Prisma ORM 2 schema by adding missing attributes. - -➤ Note -It is recommended that you make a full backup of your existing data before starting -the upgrade process. If possible, the migration should be performed in a staging -environment before executed against a production environment. - -➤ Help -If you have any questions or run into any problems along the way, -please create an issue at: -https://github.com/prisma/upgrade/issues/new - -Are you ready? [Y/n] -``` - -Press the Y button, then confirm by hitting RETURN on your keyboard to continue. - -Once you confirmed, the CLI outputs the SQL statements you should be running against your database: - - - -```no-lines wrap -➤ Adjust your database schema -Run the following SQL statements against your database: - - Fix columns with ENUM data types - https://pris.ly/d/schema-incompatibilities#enums-are-represented-as-text-in-database - - CREATE TYPE "default$default"."Role" AS ENUM ('ADMIN', 'CUSTOMER'); - ALTER TABLE "default$default"."User" ALTER COLUMN "role" SET DATA TYPE "default$default"."Role" using "role"::"default$default"."Role"; - - - Add missing `DEFAULT` constraints to the database - https://pris.ly/d/schema-incompatibilities#default-values-arent-represented-in-database - - ALTER TABLE "default$default"."User" ALTER COLUMN "role" SET DEFAULT 'CUSTOMER'; - ALTER TABLE "default$default"."Post" ALTER COLUMN "published" SET DEFAULT false; - - - Fix columns with JSON data types - https://pris.ly/d/schema-incompatibilities#json-type-is-represented-as-text-in-database - - ALTER TABLE "default$default"."User" ALTER COLUMN "jsonData" SET DATA TYPE JSONB USING "jsonData"::TEXT::JSONB; - - - Replicate `@createdAt` behavior in Prisma ORM 2 - https://pris.ly/d/schema-incompatibilities#createdat-isnt-represented-in-database - - ALTER TABLE "default$default"."Post" ALTER COLUMN "createdAt" SET DEFAULT CURRENT_TIMESTAMP; - - - Fix 1-1 relations by adding `UNIQUE` constraints - https://pris.ly/d/schema-incompatibilities#inline-1-1-relations-are-recognized-as-1-n-missing-unique-constraint - - ALTER TABLE "default$default"."Profile" ADD UNIQUE ("user"); - - - Migrate IDs from varchar(25) to varchar(30) - https://pris.ly/d/schema-incompatibilities#mismatching-cuid-length - - ALTER TABLE "default$default"."Category" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Post" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Profile" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Profile" ALTER COLUMN "user" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."User" ALTER COLUMN "id" SET DATA TYPE character varying(30); - -➤ Breaking changes detected - -In order to fully optimize your database schema, you'll need to run a few SQL -statements that can break your Prisma 1 setup. Note that these changes are optional -and if you are upgrading gradually and running Prisma 1 and Prisma ORM 2 side-by-side, -you should not perform these changes yet. Instead, you can perform them whenever -you are ready to completely remove Prisma 1 from your project. -If you are upgrading all at once, you can safely perform these changes now. - -Learn more in the docs: -https://pris.ly/d/how-to-upgrade' -``` - - - - - -```no-lines wrap -➤ Adjust your database schema -Run the following SQL statements against your database: - - Fix columns with ENUM data types - https://pris.ly/d/schema-incompatibilities#enums-are-represented-as-text-in-database - - ALTER TABLE `User` CHANGE `role` `role` ENUM('ADMIN', 'CUSTOMER') NOT NULL; - - - Add missing `DEFAULT` constraints to the database - https://pris.ly/d/schema-incompatibilities#default-values-arent-represented-in-database - - ALTER TABLE `User` CHANGE `role` `role` ENUM('ADMIN', 'CUSTOMER') NOT NULL DEFAULT 'CUSTOMER'; - ALTER TABLE `Post` CHANGE `published` `published` TINYINT(1) NOT NULL DEFAULT 0; - - - Fix columns with JSON data types - https://pris.ly/d/schema-incompatibilities#json-type-is-represented-as-text-in-database - - ALTER TABLE `User` CHANGE `jsonData` `jsonData` JSON ; - - - Replicate `@createdAt` behavior in Prisma ORM 2.0 - https://pris.ly/d/schema-incompatibilities#createdat-isnt-represented-in-database - - ALTER TABLE `Post` CHANGE `createdAt` `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; - - - Fix 1-1 relations by adding `UNIQUE` constraints - https://pris.ly/d/schema-incompatibilities#inline-1-1-relations-are-recognized-as-1-n-missing-unique-constraint - - ALTER TABLE `Profile` ADD UNIQUE (`user`); - - - Migrate IDs from varchar(25) to varchar(30) - https://pris.ly/d/schema-incompatibilities#mismatching-cuid-length - - SET FOREIGN_KEY_CHECKS=0; - ALTER TABLE `Category` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; - ALTER TABLE `Post` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; - ALTER TABLE `Profile` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; - ALTER TABLE `Profile` CHANGE `user` `user` char(30) CHARACTER SET utf8 ; - ALTER TABLE `User` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; - SET FOREIGN_KEY_CHECKS=1; - -➤ Breaking changes detected - -In order to fully optimize your database schema, you'll need to run a few SQL -statements that can break your Prisma 1 setup. Note that these changes are optional -and if you are upgrading gradually and running Prisma 1 and Prisma ORM 2 side-by-side, -you should not perform these changes yet. Instead, you can perform them whenever -you are ready to completely remove Prisma 1 from your project. -If you are upgrading all at once, you can safely perform these changes now. - -Learn more in the docs: -https://pris.ly/d/how-to-upgrade' -``` - - - -> **Note**: If you're seeing the note about breaking changes, you can ignore it for now. We'll discuss it later. - -The shown SQL statements are categorized into a number of "buckets", all aiming to resolve a certain [schema incompatibility](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql): - -- Fix columns with ENUM data types -- Add missing `DEFAULT` constraints to the database -- Fix columns with JSON data types -- Replicate `@createdAt` behavior in Prisma 2 -- Fix 1-1 relations by adding `UNIQUE` constraints - -As a next step, you can start sending the SQL statements to your database. Note that all of these changes are non-breaking and you'll be able to continue using Prisma 1 side-by-side with Prisma ORM 2. - -The next sections cover the different kinds of SQL statements to be sent to your database individually. - -### 5.1. Fix the database schema via plain SQL (non-breaking) - -In this section, we'll walk through the printed SQL statements and run them against the database one by one. - -### 5.1.1. Fix columns with ENUM data types - -The first thing the tool does is help you ensure that `enum` definitions in your Prisma 1 datamodel will be represented as actual `ENUM` types in the underlying database, right now they are represented as plain strings (e.g. as `MEDIUMTEXT` in MySQL). - -The CLI currently shows the following output: - - - -```no-lines wrap -Fix columns with ENUM data types -https://pris.ly/d/schema-incompatibilities#enums-are-represented-as-text-in-database - - CREATE TYPE "default$default"."Role" AS ENUM ('ADMIN', 'CUSTOMER'); - ALTER TABLE "default$default"."User" ALTER COLUMN "role" SET DATA TYPE "default$default"."Role" using "role"::"default$default"."Role"; -``` - -> **⚠️ Warning**: If you are running Prisma 1 and Prisma ORM 2 [side-by-side](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#upgrade-strategies), these [SQL statements will break your Prisma 1 setup](https://github.com/prisma/upgrade/issues/74). The docs will be updated to reflect this soon. - - - - - -```no-lines wrap -Fix columns with ENUM data types -https://pris.ly/d/schema-incompatibilities#enums-are-represented-as-text-in-database - - ALTER TABLE `User` CHANGE `role` `role` ENUM('ADMIN', 'CUSTOMER') NOT NULL; -``` - - - -Go ahead and run these statements against your database now. - -![Altering columns to use ENUM with SQL](images/altering-columns-to-use-enum.png) - -### 5.1.2. Add missing `DEFAULT` constraints to the database - -Next, the Upgrade CLI helps you resolve the issue that [default values aren't represented in the database](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#default-values-arent-represented-in-database) by generating SQL statements that add the respective `DEFAULT` constraints directly to the database. - -In this case, two `DEFAULT` constraints are missing which are suggested by the tool: - - - -```no-lines wrap -Add missing `DEFAULT` constraints to the database -https://pris.ly/d/schema-incompatibilities#default-values-arent-represented-in-database - - ALTER TABLE "default$default"."User" ALTER COLUMN "role" SET DEFAULT 'CUSTOMER'; - ALTER TABLE "default$default"."Post" ALTER COLUMN "published" SET DEFAULT false; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like Postico: - -![Adding missing `DEFAULT` constraints to columns](images/add-missing-default-constraints-to-columns.png) - - - - - -```no-lines wrap -Add missing `DEFAULT` constraints to the database -https://pris.ly/d/schema-incompatibilities#default-values-arent-represented-in-database - - ALTER TABLE `User` CHANGE `role` `role` ENUM('ADMIN', 'CUSTOMER') NOT NULL DEFAULT 'CUSTOMER'; - ALTER TABLE `Post` CHANGE `published` `published` TINYINT(1) NOT NULL DEFAULT 0; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like TablePlus: - -![TablePlus GUI](images/TablePlus-GUI.png) - - - -### 5.1.3. Fix columns with JSON data types - -Next, the tool helps you ensure that `Json` fields in your Prisma 1 datamodel will be represented as `JSON` columns in the underlying database, right now they are represented as plain strings (e.g. as `MEDIUMTEXT` in MySQL). - -Changing the column type to `JSON` will ensure that the field is properly recognized as `Json` during Prisma ORM 2 introspection. - -The CLI currently shows the following output: - - - -```no-lines wrap -Fix columns with JSON data types -https://pris.ly/d/schema-incompatibilities#json-type-is-represented-as-text-in-database - - ALTER TABLE "default$default"."User" ALTER COLUMN "jsonData" TYPE JSON USING "jsonData"::json; -``` - -> **⚠️ Warning**: If you are running Prisma 1 and Prisma ORM 2 [side-by-side](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#upgrade-strategies), these [SQL statements will break your Prisma 1 setup](https://github.com/prisma/upgrade/issues/73). The docs will be updated to reflect this soon. - -You can now run these SQL statements against your database either using a command line client or a GUI like Postico: - -![Adding missing `DEFAULT` constraints to columns](images/fix-columns-with-json-data-types.png) - - - - - -```no-lines wrap -Fix columns with JSON data types -https://pris.ly/d/schema-incompatibilities#json-type-is-represented-as-text-in-database - - ALTER TABLE `User` CHANGE `jsonData` `jsonData` JSON ; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like TablePlus: - -![TablePlus GUI](images/fix-columns-with-json-data-types.png) - - - -### 5.1.4. Replicate `@createdAt` behavior in Prisma ORM 2 - -The next thing the tools does is help you resolve the issue that the behavior of [`@createdAt` isn't represented in database](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#default-values-arent-represented-in-database) - -The CLI currently shows the following output: - - - -```no-lines wrap -Replicate `@createdAt` behavior in Prisma ORM 2.0 -https://pris.ly/d/schema-incompatibilities#createdat-isnt-represented-in-database - - ALTER TABLE "default$default"."Post" ALTER COLUMN "createdAt" SET DEFAULT CURRENT_TIMESTAMP; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like Postico: - -![Running an SQL command to alter a column](images/run-sql-command-to-alter-column.png) - - - - - -```no-lines wrap -Replicate `@createdAt` behavior in Prisma ORM 2.0 -https://pris.ly/d/schema-incompatibilities#createdat-isnt-represented-in-database - - ALTER TABLE `Post` CHANGE `createdAt` `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like TablePlus. - - - -### 5.1.5. Fix 1-1 relations by adding `UNIQUE` constraints - -Now, the tool will help you [turn the current 1-n relation between `User` ↔ `Profile` back into a 1-1 relation](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#inline-1-1-relations-are-recognized-as-1-n-missing-unique-constraint) by adding a `UNIQUE` constraint to the foreign key column called `user` (named after the relation field in the Prisma 1 datamodel) in the database. - -The CLI currently shows the following output: - - - -```no-lines wrap -Fix 1-1 relations by adding `UNIQUE` constraints -https://pris.ly/d/schema-incompatibilities#inline-1-1-relations-are-recognized-as-1-n-missing-unique-constraint - - ALTER TABLE "default$default"."Profile" ADD UNIQUE ("user"); -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like Postico: - -![Running an SQL command to alter a column](images/run-sql-command-to-alter-column.png) - - - - - -```no-lines wrap -Fix 1-1 relations by adding `UNIQUE` constraints -https://pris.ly/d/schema-incompatibilities#inline-1-1-relations-are-recognized-as-1-n-missing-unique-constraint - - ALTER TABLE `Profile` ADD UNIQUE (`user`); -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like TablePlus. - - - -### 5.1.6. Fix mismatch of CUID length - -> **Note**: These SQL statements will keep appearing in the Upgrade CLI even after you have changed the column types in the underlying database. This is a currently a limitation in the Upgrade CLI. - -Finally, the tool will help you [turn the current ID columns of type `VARCHAR(25)` into `VARCHAR(30)`](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#mismatching-cuid-length) by adding a `UNIQUE` constraint to the foreign key column called `user` (named after the relation field in the Prisma 1 datamodel) in the database. - -The CLI currently shows the following output: - - - -```no-lines wrap wrap -Migrate IDs from varchar(25) to varchar(30) -https://pris.ly/d/schema-incompatibilities#mismatching-cuid-length - - ALTER TABLE "default$default"."Category" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Post" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Profile" ALTER COLUMN "id" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."Profile" ALTER COLUMN "user" SET DATA TYPE character varying(30); - ALTER TABLE "default$default"."User" ALTER COLUMN "id" SET DATA TYPE character varying(30); -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like Postico: - -![Running an SQL command to alter a column](images/run-sql-command-to-alter-column.png) - - - - - -```no-lines wrap -Migrate IDs from varchar(25) to varchar(30) -https://pris.ly/d/schema-incompatibilities#mismatching-cuid-length - -SET FOREIGN_KEY_CHECKS=0; -ALTER TABLE `Category` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; -ALTER TABLE `Post` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; -ALTER TABLE `Profile` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; -ALTER TABLE `Profile` CHANGE `user` `user` char(30) CHARACTER SET utf8 ; -ALTER TABLE `User` CHANGE `id` `id` char(30) CHARACTER SET utf8 NOT NULL; -SET FOREIGN_KEY_CHECKS=1; -``` - -You can now run these SQL statements against your database either using a command line client or a GUI like TablePlus. - - - -### 5.1.7. Breaking changes detected - -In case the Upgrade CLI has printed a note about breaking changes, your database schema needs some adjustments that will break Prisma 1 compatibility in order to be fully optimized. - -If there are no breaking changes detected, you can [skip forward to section 5.2](#52-re-introspect-your-database-to-update-your-prisma-schema) - -Depending on your [upgrade strategy](/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade#upgrade-strategies), you can either perform these changes now or skip to the next phase of the Upgrade CLI: - -- If you are following the gradual side-by-side upgrade strategy, do not perform these changes yet since they will break your Prisma 1 setup. In that case, you can continue to the next phase of the Upgrade CLI by typing n and hitting RETURN. -- If you are following the all at once upgrade strategy, you can perform these changes now. In that case, continue by typing Y and hitting RETURN. - -### 5.2. Fix the database schema via plain SQL (breaking) - -In this section, you'll resolve the schema incompatibilities that are breaking your Prisma 1 setup. Do not perform these changes if you are still running Prisma 1 in your project! - -### 5.2.1. Fix incorrect m-n relations - -Now, the Upgrade CLI helps you fix all 1-1 and 1-n relations that Prisma 1 represents with relation tables and that [currently only exist as m-n relations](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#all-non-inline-relations-are-recognized-as-m-n) in your new Prisma ORM 2 schema. Concretely, this is the case for the `User` ↔ `Post` relation which currently is defined as m-n but _should_ really be a 1-n relation. - -To fix this, you'll need to perform the following migration: - -1. Create a new foreign key column on `Post` to link directly to the `User` table. -1. Migrate the foreign key values from the relation table into the new foreign key column on `Post`. -1. Delete the relation table. - -These instructions are now printed by the CLI: - - - -```no-lines wrap -➤ Adjust your database schema -Run the following SQL statements against your database: - - Fix one-to-many table relations - https://pris.ly/d/schema-incompatibilities#all-non-inline-relations-are-recognized-as-m-n - - ALTER TABLE "default$default"."Post" ADD COLUMN "authorId" character varying(25) ; - ALTER TABLE "default$default"."Post" ADD CONSTRAINT "author" FOREIGN KEY ("authorId") REFERENCES "default$default"."User"("id"); - UPDATE "default$default"."Post" SET "authorId" = "default$default"."_PostToUser"."B" FROM "default$default"."_PostToUser" WHERE "default$default"."_PostToUser"."A" = "default$default"."Post"."id"; - DROP TABLE "default$default"."_PostToUser"; - - -➤ Next Steps - -After you executed one or more of the previous SQL statements against your database, -please run the following two commands to refresh your Prisma ORM 2 schema and check -the changes. - - 1. Run `npx prisma db pull` again to refresh your Prisma ORM 2 schema. - 2. Run `npx prisma-upgrade` again. - -If you can't or don't want to execute the remaining SQL statements right now, you can -skip to the last step where the Upgrade CLI adds missing attributes to your Prisma ORM 2 -schema that are not picked up by introspection. - -Skip to the last step? [Y/n]? -``` - -For this fix, you'll need to run three SQL statements: - -1. Create new column `authorId` on the `Post` table. This column should be a _foreign key_ that references the `id` field of the `User` table: - ```sql no-lines - ALTER TABLE `Post` ADD COLUMN `authorId` VARCHAR(25); - ALTER TABLE `Post` ADD FOREIGN KEY (`authorId`) REFERENCES `User` (`id`); - ``` -1. Write a SQL query that reads all the rows from the `_PostToUser` relation table and for each row: - 1. Finds the respective `Post` record by looking up the value from column `A` - 1. Inserts the value from column `B` as the value for `authorId` into that `Post` record - ```sql no-lines - UPDATE Post, _PostToUser - SET Post.authorId = _PostToUser.B - WHERE Post.id = _PostToUser.A - ``` -1. Delete the `_PostToUser` relation table - ```sql no-lines - DROP TABLE `_PostToUser`; - ``` - -![Fixing incorrect m-n relations with SQL](images/fix-incorrect-m-n-relations-sql.png) - - - - - -```no-lines wrap -➤ Adjust your database schema -Run the following SQL statements against your database: - - Fix one-to-many table relations - https://pris.ly/d/schema-incompatibilities#all-non-inline-relations-are-recognized-as-m-n - - ALTER TABLE `Post` ADD COLUMN `authorId` char(25) CHARACTER SET utf8 ; - ALTER TABLE `Post` ADD CONSTRAINT author FOREIGN KEY (`authorId`) REFERENCES `User`(`id`); - UPDATE `Post`, `_PostToUser` SET `Post`.`authorId` = `_PostToUser`.B where `_PostToUser`.A = `Post`.`id`; - DROP TABLE `_PostToUser`; - - -➤ Next Steps - -After you executed one or more of the above SQL statements against your database, -please run the following two commands to refresh your Prisma ORM 2 Schema and check -the changes. - - 1. Run `npx prisma db pull` again to refresh your Prisma ORM 2 schema. - 2. Run `npx prisma-upgrade` again. - -If you can't or don't want to execute the remaining SQL statements right now, you can -skip to the last step where the Upgrade CLI adds missing attributes to your Prisma ORM 2 -schema that are not picked up by introspection. - -Skip to the last step? [Y/n]? -``` - -For this fix, you'll need to run three SQL statements: - -1. Create new column `authorId` on the `Post` table. This column should be a _foreign key_ that references the `id` field of the `User` table: - ```sql no-lines - ALTER TABLE `Post` ADD COLUMN `authorId` char(25) CHARACTER SET utf8 ; - ALTER TABLE `Post` ADD CONSTRAINT author FOREIGN KEY (`authorId`) REFERENCES `User`(`id`); - ``` -1. Write a SQL query that reads all the rows from the `_PostToUser` relation table and for each row: - 1. Finds the respective `Post` record by looking up the value from column `A` - 1. Inserts the value from column `B` as the value for `authorId` into that `Post` record - ```sql no-lines - UPDATE `Post`, `_PostToUser` SET `Post`.`authorId` = `_PostToUser`.B where `_PostToUser`.A = `Post`.`id`; - ``` -1. Delete the `_PostToUser` relation table - ```sql no-lines - DROP TABLE `_PostToUser`; - ``` - -![Fixing incorrect m-n relations with SQL](images/fix-incorrect-m-n-relations-sql.png) - - - -After these commands, the user ID values of the records from column `B` of the relation table are migrated to the new `authorId` column. - -### 5.2. Re-introspect your database to update your Prisma schema - -At this point, you've resolved the schema incompatibilities with the Upgrade CLI. You can now exit the Upgrade CLI for now by typing n and hitting RETURN. - -In this section, you'll update your Prisma schema with another introspection round. This time, the previous flaws of the Prisma schema will be resolved because the database schema has been adjusted: - -```terminal copy -npx prisma db pull -``` - -This time, the resulting Prisma schema looks as follows: - -```prisma file=schema.prisma -model User { - id String @id - name String - email String? @unique - jsonData Json? - role Role @default(CUSTOMER) - Post Post[] - Profile Profile? -} - -model Post { - id String @id - createdAt DateTime @default(now()) - updatedAt DateTime - title String - content String? - published Boolean @default(false) - authorId String? - User User? @relation(fields: [authorId], references: [id]) - Category Category[] @relation(references: [id]) -} - -model Category { - id String @id - name String - Post Post[] @relation(references: [id]) -} - -model Profile { - bio String? - id String @id - user String? @unique - User User? @relation(fields: [user], references: [id]) -} - -enum Role { - ADMIN - CUSTOMER -} -``` - -This schema has most issues resolved, but it still lacks the following: - -### 5.2. Add missing attributes to the Prisma 2 schema and other schema fixes - -The CLI now prints the following: - -```no-lines wrap -➤ What happens next -As a last step, some final adjustments will be made to your Prisma ORM 2 schema -to carry over some Prisma ORM-level attributes that aren't picked up by introspection. - -As a last step, some final adjustments will be made to your Prisma ORM 2.0 -schema to carry over some Prisma ORM-level attributes that aren't picked -up by introspection. - -Warning -Your current Prisma ORM 2.0 schema will be overwritten, so please -make sure you have a backup! - -Are you ready? [Y/n] -``` - -At this point, you either ran all the SQL statement that were printed by the CLI or you skipped some of them. Either way, you can now move on the last step and let the Upgrade CLI add the missing Prisma ORM 2 attributes. Typically these are the following: - -- `@default(cuid())` for your `@id` fields -- `@updatedAt` for any fields that were using this attribute in Prisma 1 -- `@map` and `@@map` as replacements for `@db` and `@@db` from Prisma 1 - -In that step, the Upgrade CLI also fixes other issues that occurred in the transition to Prisma ORM 2: - -- it makes sure that 1-1-relations that were required on both sides in Prisma 1 are also required in your Prisma ORM 2 schema -- it renames relation fields to the same names they had in your Prisma 1 datamodel ([coming soon](https://github.com/prisma/upgrade/issues/25)) - -To apply these changes, you can re-run the Upgrade CLI: - -```terminal copy -npx prisma-upgrade prisma1/prisma.yml prisma/schema.prisma -``` - -If you did not resolve all schema incompatibilities, the Upgrade CLI now prints the remaining SQL statements (as well as the ones for migrating IDs). You can just ignore them at this point and continue to the last step by continuously typing Y and hitting RETURN when prompted. - -If you did resolve all schema incompatibilities, no SQL statements will be printed and the Upgrade CLI only outputs the following: - -```no-lines wrap -$ npx prisma-upgrade prisma1/prisma.yml prisma/schema.prisma - -➤ Next Steps - -After you executed one or more of the previous SQL statements against your database, -please run the following two commands to refresh your Prisma ORM 2 schema and check -the changes. - - 1. Run `npx prisma db pull` again to refresh your Prisma ORM 2 schema. - 2. Run `npx prisma-upgrade` again. - -If you can't or don't want to execute the remaining SQL statements right now, you can -skip to the last step where the Upgrade CLI adds missing attributes to your Prisma ORM 2 -schema that are not picked up by introspection. - -Skip to the last step? [Y/n]? -``` - -One more time, type Y and hit RETURN to confirm. - -The final prompt of the Upgrade CLI now asks you to confirm the above mentioned changes it will make to your Prisma schema: - -```no-lines wrap -➤ What happens next -As a last step, some final adjustments will be made to your Prisma ORM 2 schema -to carry over some Prisma ORM-level attributes that aren't picked up by introspection. - -As a last step, some final adjustments will be made to your Prisma ORM 2.0 -schema to carry over some Prisma ORM-level attributes that aren't picked -up by introspection. - -Warning -Your current Prisma ORM 2.0 schema will be overwritten, so please -make sure you have a backup! - -Are you ready? [Y/n] -``` - -One last time, type Y and hit RETURN to confirm. - -This is the final output of the Upgrade CLI: - -```no-lines -Updating prisma/schema.prisma... -Done updating prisma/schema.prisma! - -✔ Congratulations, you're all set! - -➤ Note -If you didn't execute all generated SQL commands against your database, -you can re-run the Upgrade CLI at any time. - -Note that the Upgrade CLI doesn't resolve all of the schema incompatibilities -between Prisma 1 and Prisma ORM 2. If you want to resolve the remaining ones, -you can do so manually by following this guide: -https://pris.ly/d/upgrading-the-prisma-layer - -➤ Next steps -Otherwise you can continue your upgrade process by installing Prisma Client 2: -npm install @prisma/client - -You can find guides for different upgrade scenarios in the docs: -https://pris.ly/d/upgrade-from-prisma-1 -``` - -### 5.3. Final result - -The final version of the Prisma schema should look as follows: - -```prisma file=schema.prisma -model User { - id String @id @default(cuid()) - name String - email String? @unique - jsonData Json? - role Role @default(CUSTOMER) - Post Post[] - Profile Profile? -} - -model Post { - id String @id @default(cuid()) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - title String - content String? - published Boolean @default(false) - authorId String? - User User? @relation(fields: [authorId], references: [id]) - Category Category[] @relation(references: [id]) -} - -model Profile { - id String @id @default(cuid()) - bio String? - user String? @unique - User User? @relation(fields: [user], references: [id]) -} - -model Category { - id String @id @default(cuid()) - name String - Post Post[] @relation(references: [id]) -} - -enum Role { - ADMIN - CUSTOMER -} -``` - -### 5.4. Rename relation fields - -One thing you'll notice with this version of the Prisma ORM 2 schema is that all [relation fields](/orm/prisma-schema/data-model/relations#relation-fields) are named after their respective models, e.g: - -```prisma file=schema.prisma -model User { - Post Post[] - Profile Profile? -} - -model Post { - User User? @relation(fields: [authorId], references: [id]) - Category Category[] @relation(references: [id]) -} - -model Profile { - User User? @relation(fields: [user], references: [id]) -} - -model Category { - Post Post[] @relation(references: [id]) -} -``` - -This is not ideal and you can in fact manually rename all of them to their previous versions! - -Because all relation fields are _virtual_, meaning they don't _manifest_ in the database, you can name them whatever you like. In this case, all relation fields are lowercased and sometimes pluralized. - -Here's what they look like after the rename: - -```prisma file=schema.prisma -model User { - posts Post[] - profile Profile? -} - -model Post { - author User? @relation(fields: [authorId], references: [id]) - categories Category[] @relation(references: [id]) -} - -model Profile { - user String? @unique - owner User? @relation(fields: [user], references: [id]) -} - -model Category { - posts Post[] @relation(references: [id]) -} -``` - -> **Note**: For the 1-1-relation between `User` and `Profile` it was not possible to set the old name `user` for the relation field. This is because there'd be a naming conflict with the already existing [relation scalar](/orm/prisma-schema/data-model/relations#annotated-relation-fields) field that holds the foreign key. In that case, you can choose a different name or alternatively rename the foreign key column directly in the database via SQL. - -### 5.5. Resolving remaining schema incompatibilities - -There are a few schema incompatibilities that were not yet resolved by the Upgrade CLI. At this point you still haven't fixed [scalar lists](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#scalar-lists-arrays-are-maintained-with-extra-table) and [cascading deletes](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql#cascading-deletes-are-not-supported-in-prisma-orm-2). You can find the recommended workarounds for these on the [Schema incompatibilities](/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql) page. - -## 6. Install and generate Prisma Client - -Now that you have your Prisma ORM 2 schema ready, you can install Prisma Client with the following command: - -```terminal copy -npm install @prisma/client -``` - -## 7. Next steps - -Congratulations, you have now upgraded your Prisma ORM layer to Prisma ORM 2! From here on, you can move on to update your application code using one of the following guides: - -- [Old to new Nexus](/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-nexus-prisma-to-nexus): Choose this guide if you're currently running Prisma 1 with GraphQL Nexus. -- [prisma-binding to Nexus](/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus): Choose this guide if you're currently running Prisma 1 with `prisma-binding` and want to upgrade to [Nexus](https://www.nexusjs.org/#/) (and TypeScript). -- [prisma-binding to SDL-first](/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-sdl-first): Choose this guide if you're currently running Prisma 1 with `prisma-binding` and want to upgrade to an [SDL-first](https://www.prisma.io/blog/the-problems-of-schema-first-graphql-development-x1mn4cb0tyl3) GraphQL server. -- [REST API](/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-a-rest-api): Choose this guide if you're currently running Prisma 1 using Prisma Client 1 and are building a REST API. - -## Bonus: Prisma Client API comparison - -This section contains a high-level and side-by-side comparison of the Prisma Client APIs of Prisma 1 and Prisma ORM 2. For more details about the new Prisma Client API, you can explore the [Prisma Client](/orm/prisma-client) docs. - -### Reading single records - - - -}> - -```ts -const user = await prisma.user({ id: 1 }) -``` - - - -}> - -```ts -await prisma.user.findUnique({ - where: { id: 1 }, -}) -``` - - - - - -### Reading lists of records - - - -}> - -```ts -const user = await prisma.users() -``` - - - -}> - -```ts -await prisma.user.findMany() -``` - - - - - -### Filtering lists - - - -}> - -```ts -const users = await prisma.users({ - where: { - name: 'Alice', - }, -}) -``` - - - -}> - -```ts -await prisma.user.findMany({ - where: { - name: 'Alice', - }, -}) -``` - - - - - -### Paginating lists - - - -}> - -```ts -const posts = await prisma.posts({ - skip: 5, - first: 10, -}) -``` - - - -}> - -```ts -await prisma.user.findMany({ - skip: 5, - take: 10, -}) -``` - - - - - -> **Note**: You can learn more about the new pagination API in the respective [release notes](https://github.com/prisma/prisma/releases/tag/2.0.0-beta.7) or the [Pagination](/orm/prisma-client/queries/pagination) page in the docs. - -### Sorting lists - - - -}> - -```ts -await prisma.posts({ - orderBy: 'title_ASC', -}) -``` - - - -}> - -```ts -await prisma.posts({ - orderBy: { - title: 'asc', - }, -}) -``` - - - - - -### Creating records - - - -}> - -```ts -await prisma.createUser({ - name: 'Alice', -}) -``` - - - -}> - -```ts -await prisma.user.create({ - data: { - name: 'Alice', - }, -}) -``` - - - - - -### Updating records - - - -}> - -```ts -await prisma.updateUser({ - where: { id: 1 }, - data: { - name: 'James', - email: 'james@prisma.io', - }, -}) -``` - - - -}> - -```ts -await prisma.user.update({ - where: { id: 1 }, - data: { - name: 'James', - email: 'james@prisma.io', - }, -}) -``` - - - - - -### Deleting records - - - -}> - -```ts -await prisma.deleteUser({ id: 1 }) -``` - - - -}> - -```ts -await prisma.user.delete({ - where: { id: 1 }, -}) -``` - - - - - -### Selecting fields & loading relations - -In Prisma 1, the only ways to select specific fields and/or load relations of an object was by using the string-based `$fragment` and `$graphql` functions. With Prisma ORM 2, this is now done in a clean and type-safe manner using [`select`](/orm/prisma-client/queries/select-fields#select-specific-fields) and [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields). - -Another benefit of this approach is that you can use `select` and `include` on _any_ Prisma Client query, e.g. `findUnique`, `findMany`, `create`, `update`, `delete`, ... - - - -}> - -```ts -await prisma.user({ id: 1 }).$fragment(` - fragment NameAndEmail on User { id email }` -`) -``` - - - -}> - -```ts -await prisma.user.findUnique({ - where: { id: 1 }, - select: { - id: true, - email: true, - }, -}) -``` - - - - - -As an example, creating a new record and only retrieving the `id` in the returned object was not possible in Prisma 1. With Prisma ORM 2 you can achieve this as follows: - -```ts -await prisma.user.create({ - data: { - name: 'Alice', - }, - select: { - id: true, - }, -}) -``` diff --git a/content/400-pulse/700-feedback.mdx b/content/400-pulse/700-feedback.mdx index 8fe9bf14bf..6a3b7b6f5e 100644 --- a/content/400-pulse/700-feedback.mdx +++ b/content/400-pulse/700-feedback.mdx @@ -3,7 +3,6 @@ title: 'Feedback' metaTitle: 'Prisma Pulse: Feedback' metaDescription: 'Learn where to submit feedback about Prisma Pulse.' tocDepth: 3 -toc: true --- diff --git a/gatsby-node.ts b/gatsby-node.ts deleted file mode 100644 index ec81aeb796..0000000000 --- a/gatsby-node.ts +++ /dev/null @@ -1,228 +0,0 @@ -const path = require('path') -// const docTemplate = path.resolve(`./src/templates/docs.tsx`); - -exports.onCreateNode = ({ node, getNode, actions }: any) => { - const { createNodeField } = actions - if (node.internal.type === `Mdx`) { - const parent = getNode(node.parent) - let value = parent.relativePath.replace(parent.ext, '') - if (value === 'index') { - value = '' - } - - createNodeField({ - node, - name: `slug`, - value: `/${value}`, - }) - createNodeField({ - node, - name: 'id', - value: node.id, - }) - createNodeField({ - node, - name: 'modSlug', - value: `/${value.replace('/index', '')}`, - }) - } -} - -const getTitle = (frontmatter: any, lang?: any, db?: any) => { - let pageSeoTitle = frontmatter.metaTitle || frontmatter.title - if (lang || db) { - const queryParam = `${lang ? `${lang}${db ? '-' : ''}` : ''}${db ? `${db}` : ''}` - const titleEntry = frontmatter.techMetaTitles - ? frontmatter.techMetaTitles.find((item: any) => item.name === queryParam) - : null - pageSeoTitle = titleEntry ? titleEntry.value : `${pageSeoTitle} : ${queryParam}` - } - return pageSeoTitle -} - -const getDesc = (frontmatter: any, lang?: any, db?: any) => { - let pageSeoDesc = frontmatter.metaDescription || frontmatter.title - if (lang || db) { - const queryParam = `${lang ? `${lang}${db ? '-' : ''}` : ''}${db ? `${db}` : ''}` - const descEntry = frontmatter.techMetaDescriptions - ? frontmatter.techMetaDescriptions.find((item: any) => item.name === queryParam) - : null - pageSeoDesc = descEntry ? descEntry.value : pageSeoDesc - } - - return pageSeoDesc -} - -exports.createPages = async ({ graphql, actions, reporter }: any) => { - const { createPage, createRedirect } = actions - - const result = await graphql(` - query { - allMdx { - nodes { - id - fields { - slug - id - modSlug - } - frontmatter { - title - metaTitle - metaDescription - langSwitcher - dbSwitcher - techMetaTitles { - name - value - } - techMetaDescriptions { - name - value - } - } - internal { - contentFilePath - } - } - } - site { - siteMetadata { - redirects { - from - to - } - } - } - } - `) - - if (result.errors) { - reporter.panicOnBuild('Error loading MDX result', result.errors) - } - - // Create blog post pages. - const posts = result.data.allMdx.nodes - const redirects = result.data.site.siteMetadata.redirects - - // you'll call `createPage` for each result - posts.forEach((node: any) => { - // createPage({ - // // As mentioned above you could also query something else like frontmatter.title above and use a helper function - // // like slugify to create a slug - // path: node.fields.modSlug - // ? node.fields.modSlug.replace(/\d{2,}-/g, "") - // : "/", - // // Provide the path to the MDX content file so webpack can pick it up and transform it into JSX - // component: `${docTemplate}?__contentFilePath=${node.internal.contentFilePath}`, - // // You can use the values in this context in - // // our page layout component - // context: { - // id: node.id, - // seoTitle: getTitle(node.frontmatter), - // seoDescription: getDesc(node.frontmatter), - // }, - // }); - const { langSwitcher, dbSwitcher } = node.frontmatter - if (langSwitcher && dbSwitcher) { - langSwitcher.forEach((lang: any) => - dbSwitcher.forEach((db: any) => { - createPage({ - path: `${node.fields.modSlug.replace(/\d{2,}-/g, '')}-${lang}-${db}`, - component: path.resolve('./src/templates/docs.tsx'), - context: { - id: node.fields.id, - seoTitle: getTitle(node.frontmatter, lang, db), - seoDescription: getDesc(node.frontmatter, lang, db), - }, - }) - }) - ) - } else if (langSwitcher && !dbSwitcher) { - langSwitcher.forEach((lang: any) => - createPage({ - path: `${node.fields.modSlug.replace(/\d{2,}-/g, '')}-${lang}`, - component: path.resolve('./src/templates/docs.tsx'), - context: { - id: node.fields.id, - seoTitle: getTitle(node.frontmatter, lang, null), - seoDescription: getDesc(node.frontmatter, lang, null), - }, - }) - ) - } else if (!langSwitcher && dbSwitcher) { - node.frontmatter.dbSwitcher.forEach((db: any) => - createPage({ - path: `${node.fields.modSlug.replace(/\d{2,}-/g, '')}-${db}`, - component: path.resolve('./src/templates/docs.tsx'), - context: { - id: node.fields.id, - seoTitle: getTitle(node.frontmatter, null, db), - seoDescription: getDesc(node.frontmatter, null, db), - }, - }) - ) - } else if (!langSwitcher && !dbSwitcher) { - createPage({ - path: node.fields.modSlug ? node.fields.modSlug.replace(/\d{2,}-/g, '') : '/', - component: path.resolve('./src/templates/docs.tsx'), - context: { - id: node.fields.id, - seoTitle: getTitle(node.frontmatter), - seoDescription: getDesc(node.frontmatter), - }, - }) - } - }) - - redirects - .filter((redirect: any) => !redirect.from.includes('#')) - .map((redirect: any) => - createRedirect({ - fromPath: redirect.from, - toPath: redirect.to, - statusCode: 301, - }) - ) -} - -exports.createSchemaCustomization = ({ actions }: any) => { - const { createTypes } = actions - const typeDefs = ` - type MarkdownRemark implements Node { - frontmatter: Frontmatter - } - type Frontmatter { - title: String! - navTitle: String - metaTitle: String - metaDescription: String - langSwitcher: [String!] - dbSwitcher: [String!] - staticLink: Boolean - duration: String - preview: Boolean - deprecated: Boolean - earlyaccess: Boolean - highlight: Boolean - toc: Boolean - hidePage: Boolean - tocDepth: Int - codeStyle: Boolean - } - ` - createTypes(typeDefs) -} - -exports.onCreateWebpackConfig = ({ stage, actions }: any) => { - actions.setWebpackConfig({ - devtool: false, - resolve: { - modules: [path.resolve(__dirname, 'src'), 'node_modules'], - alias: { - $components: path.resolve(__dirname, 'src/components'), - buble: '@philpl/buble', // to reduce bundle size - }, - }, - }) -} diff --git a/src/components/footer.tsx b/src/components/footer.tsx deleted file mode 100644 index a17a6946a7..0000000000 --- a/src/components/footer.tsx +++ /dev/null @@ -1,529 +0,0 @@ -import * as React from 'react' -import { AnchorHTMLAttributes } from 'react' -import styled, { css } from 'styled-components' - -import { darkTheme, defaultTheme as theme } from '../theme' -import { Icon } from './Icon' -import { FooterNewsletterForm } from './newsletter/FooterNewsletterForm' -import CustomLink from './customLink' - -const FooterWrapper = styled.div` - background: transparent; - width: 100%; - display: flex; - justify-content: center; - color: ${theme.colors.gray[500]}; - > div { - width: 100%; - } - @media (prefers-color-scheme: dark) { - form { - i { - color: ${theme.colors.gray[300]} !important; - } - .input-el { - background: ${theme.colors.gray[800]} !important; - border-color: ${theme.colors.gray[700]} !important; - color: ${theme.colors.gray[100]} !important; - &::placeholder { - color: ${theme.colors.gray[300]}; - } - } - } - } -` - -type ColorType = 'indigo' | 'teal' | 'white' | undefined - -export const Container = styled.div` - box-sizing: border-box; - margin: auto; - width: 100%; - padding: 0 2rem; - @media only screen and (min-width: 940px) { - padding: 0 1.5rem; - max-width: 1248px; // 1200 plus 2 x padding - } -` - -namespace S { - export const defaultText = (footer: any) => css` - color: ${footer.linkColor}; - font-size: ${footer.linkSize}; - font-weight: 400; - ` - - export const Container = styled.div<{ theme: any }>` - position: absolute; - left: 0; - background-color: ${(props) => props.theme.footer.backgroundColor}; - padding: 72px 0 24px; - width: 100%; - @media only screen and (min-width: 768px) { - padding: 46px 0 100px; - } - ` - - export const Row = styled.div` - font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI'; - @media only screen and (min-width: 940px) { - display: flex; - } - ` - - export const SocialLinksWrapper = styled.div` - display: flex; - justify-content: space-between; - align-items: center; - ` - - export const PrismaLogo = styled.div` - display: flex; - justify-content: center; - flex-direction: column; - .prisma-logo-img { - margin-bottom: ${(props) => props.theme.space[8]}; - } - ` - - export const PrismaDataText = styled.div` - font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI'; - ${(props) => defaultText(props.theme.footer)} - ` - - export const FooterWrapper = styled.div` - display: flex; - font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI'; - flex-direction: column-reverse; - @media only screen and (min-width: ${(props) => props.theme.breakpoints.tabletVertical}px) { - flex-direction: column; - } - ` - - export const NewsletterRow = styled.div` - > h4 { - margin-bottom: 16px; - margin-right: 32px; - } - margin-bottom: 0; - @media only screen and (min-width: ${(props) => props.theme.breakpoints.tabletVertical}px) { - padding: 64px 0; - display: flex; - justify-content: flex-start; - align-items: flex-start; - flex-direction: column; - margin-bottom: 64px; - border-top: 1px solid ${(props) => props.theme.colors.gray[300]}; - border-bottom: 1px solid ${(props) => props.theme.colors.gray[300]}; - } - @media only screen and (min-width: ${(props) => props.theme.breakpoints.tabletHorizontal}px) { - margin-top: 64px; - flex-direction: row; - justify-content: space-between; - align-items: center; - > h4 { - margin-bottom: 0; - } - } - ` - - export const Column = styled.div<{ flex?: number }>` - margin-bottom: 48px; - @media only screen and (min-width: ${(props) => props.theme.footer.mobileBreakpoint}px) { - margin-bottom: 0; - padding: 0 0.5rem; - flex: ${(props) => props.flex || 1}; - } - ` - - export const Title = styled.h4` - text-transform: uppercase; - font-weight: 400; - font-size: ${(props) => props.theme.footer.titleSize}; - color: ${(props) => props.theme.footer.titleColor}; - letter-spacing: 0.08em; - margin-top: 0; - margin-bottom: 1rem; - @media only screen and (min-width: ${(props) => props.theme.footer.mobileBreakpoint}px) { - margin-bottom: 0; - } - ` - - type LinkProps = AnchorHTMLAttributes & { - theme: any - active?: boolean - external?: boolean - color?: ColorType - } - - export const Link = ({ external, theme, color = 'indigo', ...rest }: LinkProps) => { - return ( - - {rest.children} - {external && } - - ) - } - - const StyledLink = styled(CustomLink)<{ - color?: ColorType - }>( - ({ color = 'indigo' }) => css` - ${(props) => defaultText(props.theme.footer)}; - display: flex; - cursor: pointer; - font-weight: 500; - box-sizing: border-box; - text-decoration: none; - line-height: ${25 / 18}; - padding: 1rem 0; - @media only screen and (min-width: ${(props) => props.theme.footer.mobileBreakpoint}px) { - padding: 0.5rem 0; - } - &:hover { - color: ${(props) => props.theme.footer.linkHoverColor[color]}; - } - > i { - margin: 5px 0 0 3px; - } - > span { - margin-left: 6px; - } - .link-title-label { - display: flex; - align-items: center; - .label { - margin-left: 8px; - background: ${theme.colors[color]['600']}; - border-radius: 99px; - padding: 6px 8px; - font-family: 'Barlow'; - font-style: normal; - font-weight: 700; - font-size: 8px; - line-height: 100%; - white-space: nowrap; - /* identical to box height, or 8px */ - - display: flex; - align-items: center; - letter-spacing: 0.1em; - text-transform: uppercase; - color: white; - } - } - ` - ) - - export const SocialLinksContainer = styled.div<{ - color?: ColorType - theme?: boolean - }>( - ({ color = 'indigo' }) => css` - justify-content: start; - gap: 20px; - display: none; - @media only screen and (min-width: 768px) { - display: flex; - } - a { - font-size: 1.375rem; - color: ${(props) => props.theme.footer.linkColor}; - &:hover { - color: ${(props) => props.theme.footer.linkHoverColor[color]}; - } - } - i { - pointer-events: none; - } - ` - ) -} - -interface FooterProps { - className?: string - color?: ColorType - lightTheme?: boolean - absoluteLinks?: boolean - newsletterComponent?: any -} - -const FooterSec = ({ - className, - lightTheme = false, - absoluteLinks = true, - newsletterComponent, - color = 'indigo', -}: FooterProps) => { - const themeToUse = lightTheme ? theme : darkTheme - const newsletter = newsletterComponent ? ( - newsletterComponent - ) : ( - - ) - return ( - - - - - - - Product - - ORM - - -
Accelerate
-
- -
Pulse
-
- - Pricing - -
- - - Resources - - Docs - - - Get started - - - prisma-examples - - - Prisma ORM in your stack - - - Ecosystem - - - Tutorials - - - Playground - - - Customer stories - - - Data guide - - - Data Platform status - - - VS Code extension - - - - - Contact us - - Community - - - Support - - - Enterprise - - - - - Company - - About - - - Blog - - - Data DX - - - Careers{' '} - - - Events - - - Causes - - - OSS Friends - - - Terms & Privacy - - - Service Level Agreement - - -
- - Newsletter - {newsletter} - -
- - -
- prisma_logo -
- - © {new Date().getFullYear()} Prisma Data, Inc. - -
- - - - - - - - - - - - - - - - - -
-
-
-
- ) -} - -export default FooterSec diff --git a/src/components/layout.tsx b/src/components/layout.tsx deleted file mode 100644 index 11d7cfc19d..0000000000 --- a/src/components/layout.tsx +++ /dev/null @@ -1,231 +0,0 @@ -import { MDXProvider } from '@mdx-js/react' -import { RouterProps } from '@reach/router' -import { Script } from 'gatsby' -import React, { useState } from 'react' -import StickyBox from 'react-sticky-box' -import styled from 'styled-components' - -import { useLayoutQuery } from '../hooks/useLayoutQuery' -import { defaultTheme as theme } from '../theme' -import Footer from './footer' -import Header from './header' -import SearchBox from './search/minimalInput' -import shortcodes from './shortcodes' -import SidebarLayout from './sidebar' -import TableOfContents from './toc' -import { WebProvider } from './WebProvider' - -import '../styles/layout.css' - -interface LayoutContentProps { - toc: any - tocDepth?: number - slug?: string - homePage?: boolean - children: React.ReactNode - wide?: boolean -} - -type LayoutProps = RouterProps & LayoutContentProps - -const Wrapper = styled.div<{ homePage?: boolean }>` - display: flex; - width: 100%; - justify-content: center; - //${(p) => (p.homePage ? 'padding: 80px 0 0 0' : 'padding: 80px 0')}; - @media (max-width: ${theme.breakpoints.tabletVertical}) { - padding: 0; - } -` - -const Content = styled.article<{ homePage?: boolean; wide?: boolean }>` - ${(p) => - p.homePage - ? 'max-width: 100%;' - : p.wide - ? 'min-width: 0; max-width: 988px; flex-shrink: 1; padding: 0 1rem;' - : 'max-width: 748px; margin: 0 20px;'} - flex: 1; - position: relative; - z-index: 100; - width: 100%; - @media (min-width: 0px) and (max-width: 1024px) { - margin: 0; - max-width: 100%; - } - @media (min-width: 1025px) and (max-width: 1240px) { - margin: 0; - ${(p) => (p.homePage ? 'max-width: 100%' : 'max-width: 570px')}; - } - section { - > h1, - h2, - h3, - h4, - h5, - h6 { - &:has(> inlinecode) { - line-height: 1.5; - } - } - } -` - -const MaxWidth = styled.div<{ wide?: boolean }>` - > section { - padding: 0 ${(p) => `${theme.space[40]}${p.wide ? ` 0 0` : ``}`}; - &.top-section { - padding-top: 0; - } - @media (min-width: 0px) and (max-width: 1024px) { - margin-top: ${theme.space[8]}; - } - @media (min-width: 0px) and (max-width: 1024px) { - padding: 0 ${theme.space[24]}; - &.top-section { - padding-top: ${theme.space[24]}; - } - } - } -` - -const NotMobile = styled.section` - display: flex; - height: fit-content; - @media (min-width: 0px) and (max-width: 1024px) { - display: none; - } - &.fixed { - position: sticky; - } -` - -const Container = styled.div<{ homePage?: boolean; wide?: boolean }>` - ${(p) => (p.homePage ? 'max-width: 100%;' : p.wide ? 'max-width: 1440px' : 'max-width: 1240px')}; - width: 100%; - justify-content: center; - display: flex; - align-items: flex-start; - position: relative; - - ${(p) => (p.homePage ? `margin-top: 0` : `margin-top: ${theme.space[40]};`)} - @media (max-width: 1024px) { - ${(p) => (p.homePage ? `margin-top: 0` : `margin-top: 118px;`)} - } -` - -const TOCWrapper = styled.div<{ wide?: boolean }>` - width: 180px; - height: 85vh; - flex-shrink: 0; - overflow-y: auto; - position: sticky; - top: 20px; - ${(p) => p.wide && `margin-right: -100px;`} - - @media (min-width: 0px) and (max-width: 1024px) { - display: none; - } - &.fixed { - position: sticky; - } -` - -const FooterWrapper = styled.div` - button { - z-index: 10; - } -` - -const SearchComponentDesktop = styled.div<{ open?: boolean }>` - width: calc(100% - ${theme.space[16]}); - padding: 0 0 22px 0; - @media (min-width: 0px) and (max-width: 1024px) { - display: none; - } -` - -const CustomSticky = styled(StickyBox)` - width: 272px; - margin: 0px -${theme.space[16]} 0 ${theme.space[16]}; - @media (min-width: 0px) and (max-width: 1024px) { - width: auto; - } -` - -const LayoutWrapper = styled.div<{ mobileNavOpen?: boolean }>` - ${(p) => p.mobileNavOpen && 'position: fixed;'} -` - -export default function Layout({ - children, - toc, - tocDepth, - location, - slug, - homePage, - wide, -}: LayoutProps) { - const { site } = useLayoutQuery() - const { header, footer } = site.siteMetadata - const [mobileNavOpen, setMobileNav] = useState(false) - const [showDocsBtn, setShowDocsBtn] = React.useState(true) - const queryString = new URLSearchParams(location?.search).get('query') - const [value, setValue] = useState(queryString || '') - - const closeSidenavSearch = () => setShowDocsBtn(true) - - const showHeaderSearch = () => setShowDocsBtn(false) - - const setInputText = (input: any) => setValue(input) - return ( - - - - {/* OneTrust Cookies Consent Notice start for prisma.io */} - - {/* OneTrust Cookies Consent Notice end for prisma.io */} - - {props.headComponents} - - - {props.preBodyComponents} -
- {props.postBodyComponents} - - - ) -} - -HTML.propTypes = { - htmlAttributes: PropTypes.object, - headComponents: PropTypes.array, - bodyAttributes: PropTypes.object, - preBodyComponents: PropTypes.array, - body: PropTypes.string, - postBodyComponents: PropTypes.array, -} - -export default HTML diff --git a/src/interfaces/Article.interface.ts b/src/interfaces/Article.interface.ts deleted file mode 100644 index 5117f57205..0000000000 --- a/src/interfaces/Article.interface.ts +++ /dev/null @@ -1,57 +0,0 @@ -export interface ArticleFields { - slug: string - modSlug: string -} - -export interface ArticleFrontmatter { - title: string - navTitle?: string - metaTitle?: string - metaDescription?: string - langSwitcher?: string[] - dbSwitcher?: string[] - search?: boolean - wide?: boolean - staticLink?: boolean - duration?: string - preview?: boolean - earlyaccess?: boolean - highlight?: boolean - toc?: boolean - hidePage?: boolean - tocDepth?: number - codeStyle?: boolean - deprecated?: boolean - hideTitle?: boolean -} - -export interface ArticleData { - mdx: { - fields: ArticleFields - tableOfContents: TableOfContents - body: string - parent: any - frontmatter: ArticleFrontmatter - } - site: { - siteMetadata: { - docsLocation: string - } - } -} - -export interface ArticleQueryData { - data: ArticleData -} - -export interface Fields { - fields: ArticleFields -} - -export interface TableOfContents { - items: { - url: string - title: string - items?: any[] - }[] -} diff --git a/src/utils/treeData.ts b/src/utils/treeData.ts deleted file mode 100644 index 62a2d681ae..0000000000 --- a/src/utils/treeData.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { urlGenerator } from './urlGenerator' -import { ArticleFields, ArticleFrontmatter } from '../interfaces/Article.interface' - -interface TreeNode { - node: { - fields: ArticleFields - frontmatter: ArticleFrontmatter - } -} - -const getCollpaseState = (part: string, location: any) => { - const mainpath = location.pathname.replace(/^\/|\/$/g, '').split('/') - const subpath = urlGenerator(part) - .replace(/^\/|\/$/g, '') - .split('/') - - const state = subpath.every((val) => mainpath.includes(val)) - return !state -} - -// TODO::Simplify the function -export const calculateTreeData = (edges: any, defaultCollapsed: any, location: any) => { - const tree = edges.reduce( - ( - accu: any, - { - node: { - fields: { slug, modSlug }, - frontmatter: { - title, - navTitle, - staticLink, - duration, - preview, - deprecated, - earlyaccess, - highlight, - dbSwitcher, - langSwitcher, - hidePage, - codeStyle, - hideTitle, - }, - }, - }: TreeNode - ) => { - const parts = slug.split('/') - const topLevel = parts.length == 3 && parts[parts.length - 1] === 'index' ? true : false - let { items: prevItems } = accu - const slicedParts = parts.slice(1, -1) - const newParams = `${langSwitcher ? `${langSwitcher[0]}${dbSwitcher ? '-' : ''}` : ''}${ - dbSwitcher ? `${dbSwitcher[0]}` : '' - }` - for (const part of slicedParts) { - let tmp = prevItems && prevItems.find(({ label }: any) => label == part) - if (tmp) { - if (!tmp.items) { - tmp.items = [] - } - } else { - tmp = { - label: part, - items: [], - topLevel, - preview, - deprecated, - earlyaccess, - highlight, - staticLink, - } - prevItems.push(tmp) - } - if (parts[parts.length - 1] === 'index' && parts[parts.length - 2] === part) { - tmp.url = `${urlGenerator(modSlug)}${newParams ? '-' + newParams : ''}` - tmp.slug = slug - tmp.title = title - tmp.navTitle = navTitle - tmp.staticLink = staticLink - tmp.duration = duration - tmp.preview = preview - tmp.deprecated = deprecated - tmp.earlyaccess = earlyaccess - tmp.highlight = highlight - tmp.topLevel = topLevel - tmp.hidePage = hidePage - tmp.codeStyle = codeStyle - tmp.parentLabel = parts[parts.length - 3] - tmp.parents = parts.filter((part) => part !== 'index') - tmp.hideTitle = hideTitle - if (defaultCollapsed && location) { - defaultCollapsed[part.toLowerCase()] = - tmp.topLevel || tmp.staticLink ? null : getCollpaseState(modSlug, location) - } - } - - prevItems = tmp.items - } - const slicedLength = parts.length - 1 - const existingItem = prevItems.find(({ label }: any) => label === parts[slicedLength]) - - if (!existingItem) { - prevItems.push({ - label: parts[slicedLength], - url: `${urlGenerator(modSlug)}${newParams ? '-' + newParams : ''}`, - slug: slug, - items: [], - title, - navTitle, - hideTitle, - staticLink, - duration, - preview, - deprecated, - earlyaccess, - highlight, - topLevel, - hidePage, - codeStyle, - parentLabel: parts[parts.length - 3], - parents: parts.filter((part) => part !== 'index'), - }) - } - - return accu - }, - { items: [] } - ) - return tree -} diff --git a/vercel.json b/vercel.json deleted file mode 100644 index bebbe5c5ec..0000000000 --- a/vercel.json +++ /dev/null @@ -1,3811 +0,0 @@ -{ - "headers": [ - { - "source": "/(.*)", - "headers": [ - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Strict-Transport-Security", - "value": "max-age=63072000; includeSubDomains; preload" - }, - { - "key": "Content-Security-Policy", - "value": "default-src data: 'unsafe-inline' 'unsafe-eval' https:; script-src data: 'unsafe-inline' 'unsafe-eval' https: blob:; style-src data: 'unsafe-inline' https:; img-src data: https: blob:; font-src data: https:; connect-src https: wss: blob:; media-src https: blob:; object-src https:; child-src https: data: blob:; form-action https:; block-all-mixed-content" - }, - { - "key": "X-Frame-Options", - "value": "DENY" - }, - { - "key": "X-Content-Type-Options", - "value": "nosniff" - }, - { - "key": "Referrer-Policy", - "value": "no-referrer" - }, - { - "key": "Feature-Policy", - "value": "microphone 'none'; geolocation 'none'" - }, - { - "key": "Cache-Control", - "value": "public, max-age=0, s-maxage=31536000, immutable" - } - ] - } - ], - "redirects": [ - { - "source": "/docs/page-data/docs/:any*", - "destination": "/docs/page-data/index/:any*" - }, - { - "source": "/docs/faq/:any*", - "destination": "https://v1.prisma.io/docs/1.34/faq/:any*" - }, - { - "source": "/docs/-a002", - "destination": "https://v1.prisma.io/docs/1.34/get-started/" - }, - { - "source": "/docs/-t002", - "destination": "https://v1.prisma.io/docs/1.34/get-started/" - }, - { - "source": "/docs/-t002/", - "destination": "https://v1.prisma.io/docs/1.34/get-started/" - }, - { - "source": "/docs/prisma-admin/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-admin/" - }, - { - "source": "/docs/prisma-cli-and-configuration/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-cli-and-configuration/" - }, - { - "source": "/docs/prisma-client/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/" - }, - { - "source": "/docs/prisma-server/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-server/" - }, - { - "source": "/docs/quickstart/", - "destination": "https://v1.prisma.io/docs/1.34/get-started/" - }, - { - "source": "/docs/releases-and-maintenance/", - "destination": "https://v1.prisma.io/docs/1.34/releases-and-maintenance/" - }, - { - "source": "/docs/datamodel-and-migrations/", - "destination": "https://v1.prisma.io/docs/1.34/datamodel-and-migrations" - }, - { - "source": "/docs/get-started/01-setting-up-prisma-new-database-GO-g002/", - "destination": "https://v1.prisma.io/docs/1.34/get-started" - }, - { - "source": "/docs/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002/", - "destination": "https://v1.prisma.io/docs/1.34/get-started" - }, - { - "source": "/docs/get-started/01-setting-up-prisma-demo-server-a001/", - "destination": "https://v1.prisma.io/docs/1.34/get-started/01-setting-up-prisma-demo-server-JAVASCRIPT-a001/" - }, - { - "source": "/docs/get-started/01-setting-up-prisma-existing-database-a003/", - "destination": "https://v1.prisma.io/docs/1.34/get-started/01-setting-up-prisma-demo-server-JAVASCRIPT-a001/" - }, - { - "source": "/docs/get-started/01-setting-up-prisma-new-database-a002/", - "destination": "https://v1.prisma.io/docs/1.34/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002/" - }, - { - "source": "/docs/datamodel-and-migrations/datamodel-MYSQL-knul/", - "destination": "https://v1.prisma.io/docs/1.34/datamodel-and-migrations" - }, - { - "source": "/docs/data-model-and-migrations/introspection-mapping-to-existing-db-soi1/", - "destination": "https://v1.prisma.io/docs/1.34/data-model-and-migrations/introspection-mapping-to-existing-db-soi1/" - }, - { - "source": "/docs/understand-prisma/how-prisma-works-under-the-hood-j8ff/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/how-prisma-works-under-the-hood-j8ff/" - }, - { - "source": "/docs/understand-prisma/prisma-basics-datamodel-client-and-server-fgz4/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/prisma-basics-datamodel-client-and-server-fgz4/" - }, - { - "source": "/docs/understand-prisma/prisma-introduction-what-why-how-j9ff/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/prisma-introduction-what-why-how-j9ff/" - }, - { - "source": "/docs/understand-prisma/prisma-vs-traditional-orms/prisma-vs-mongoose-ys8c/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/prisma-vs-traditional-orms/prisma-vs-mongoose-ys8c/" - }, - { - "source": "/docs/understand-prisma/prisma-vs-traditional-orms/prisma-vs-sequelize-c4fk/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/prisma-vs-traditional-orms/prisma-vs-sequelize-c4fk/" - }, - { - "source": "/docs/understand-prisma/prisma-vs-traditional-orms/prisma-vs-typeorm-k9fh/", - "destination": "https://v1.prisma.io/docs/1.34/understand-prisma/prisma-vs-traditional-orms/prisma-vs-typeorm-k9fh/" - }, - { - "source": "/docs/prisma-client/basic-data-access/reading-data-GO-go05/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/reading-data-GO-go05/" - }, - { - "source": "/docs/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/" - }, - { - "source": "/docs/prisma-client/basic-data-access/reading-data-TYPESCRIPT-rsc3/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/reading-data-TYPESCRIPT-rsc3/" - }, - { - "source": "/docs/prisma-client/basic-data-access/writing-data-GO-go08/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/writing-data-GO-go08/" - }, - { - "source": "/docs/prisma-client/basic-data-access/writing-data-JAVASCRIPT-rsc6/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/writing-data-JAVASCRIPT-rsc6/" - }, - { - "source": "/docs/prisma-client/basic-data-access/writing-data-TYPESCRIPT-rsc7/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/basic-data-access/writing-data-TYPESCRIPT-rsc7/" - }, - { - "source": "/docs/prisma-client/features/check-existence-GO-go01/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/check-existence-GO-go01/" - }, - { - "source": "/docs/prisma-client/features/check-existence-JAVASCRIPT-pyl1/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/check-existence-JAVASCRIPT-pyl1/" - }, - { - "source": "/docs/prisma-client/features/check-existence-TYPESCRIPT-pyl2/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/check-existence-TYPESCRIPT-pyl2/" - }, - { - "source": "/docs/prisma-client/features/realtime-GO-go06/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/realtime-GO-go06/" - }, - { - "source": "/docs/prisma-client/features/realtime-JAVASCRIPT-rsc8/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/realtime-JAVASCRIPT-rsc8/" - }, - { - "source": "/docs/prisma-client/features/realtime-TYPESCRIPT-rsc9/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/features/realtime-TYPESCRIPT-rsc9/" - }, - { - "source": "/docs/prisma-client/setup/constructor-GO-go02/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/constructor-GO-go02/" - }, - { - "source": "/docs/prisma-client/setup/constructor-JAVASCRIPT-rsc4/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/constructor-JAVASCRIPT-rsc4/" - }, - { - "source": "/docs/prisma-client/setup/constructor-TYPESCRIPT-rsc5/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/constructor-TYPESCRIPT-rsc5/" - }, - { - "source": "/docs/prisma-client/setup/generating-the-client-GO-r3c3/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/generating-the-client-GO-r3c3/" - }, - { - "source": "/docs/prisma-client/setup/generating-the-client-JAVASCRIPT-rsc1/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/generating-the-client-JAVASCRIPT-rsc1/" - }, - { - "source": "/docs/prisma-client/setup/generating-the-client-TYPESCRIPT-r3c2/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-client/setup/generating-the-client-TYPESCRIPT-r3c2/" - }, - { - "source": "/docs/run-prisma-server/database-connector-MYSQL-jgfs/", - "destination": "https://v1.prisma.io/docs/1.34/prisma-server/database-connector-MYSQL-jgfs/" - }, - { - "source": "/docs/guides/database-workflows/setting-up-a-database/postgresql", - "destination": "/docs/dataguide/postgresql/setting-up-a-local-postgresql-database" - }, - { - "source": "/docs/guides/database-workflows/setting-up-a-database/mysql", - "destination": "/docs/dataguide/mysql/setting-up-a-local-mysql-database" - }, - { - "source": "/docs/guides/database-workflows/setting-up-a-database/sqlite", - "destination": "/docs/dataguide/sqlite/setting-up-a-local-sqlite-database" - }, - { - "source": "/docs/guides/database-workflows/import-and-export-data/postgresql", - "destination": "/docs/dataguide/postgresql/inserting-and-modifying-data/importing-and-exporting-data-in-postgresql" - }, - { - "source": "/docs/guides/database-workflows/import-and-export-data/mysql", - "destination": "/docs/dataguide/mysql/importing-and-exporting-data-in-mysql" - }, - { - "source": "/docs/guides/database-workflows/import-and-export-data/sqlite", - "destination": "/docs/dataguide/sqlite/importing-and-exporting-data-in-sqlite" - }, - { - "source": "/docs/guides/database-workflows/:any*", - "destination": "/docs/guides/general-guides/database-workflows/:any*" - }, - { - "source": "/docs/guides/troubleshooting", - "destination": "/docs/support/help-articles" - }, - { - "source": "/docs/guides/troubleshooting/autocompletion-in-graphql-resolvers-with-js", - "destination": "/docs/support/help-articles/autocompletion-in-graphql-resolvers-with-js" - }, - { - "source": "/docs/getting-started/quickstart-typescript", - "destination": "/docs/getting-started/quickstart" - }, - { - "source": "/docs/getting-started/quickstart-javascript", - "destination": "/docs/getting-started/quickstart" - }, - { - "source": "/docs/getting-started/quickstart-node", - "destination": "/docs/getting-started/quickstart" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-schema/prisma-schema-file", - "destination": "/docs/reference/tools-and-interfaces/prisma-schema" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-client/api", - "destination": "/docs/reference/tools-and-interfaces/prisma-client" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-client/api", - "destination": "/docs/reference/tools-and-interfaces/prisma-client" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/should-you-upgrade", - "destination": "/docs/guides/upgrade-from-prisma-1/how-to-upgrade" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-schema/models", - "destination": "/docs/reference/tools-and-interfaces/prisma-schema/data-model" - }, - { - "source": "/docs/concepts/overview/api-comparisons/prisma-and-typeorm", - "destination": "/docs/concepts/more/comparisons/prisma-and-typeorm" - }, - { - "source": "/docs/concepts/overview/api-comparisons/prisma-and-sequelize", - "destination": "/docs/concepts/more/comparisons/prisma-and-sequelize" - }, - { - "source": "/docs/concepts/overview/api-comparisons/prisma-and-mongoose", - "destination": "/docs/concepts/more/comparisons/prisma-and-mongoose" - }, - { - "source": "/docs/concepts/overview/why-prisma/api-comparisons/prisma-and-typeorm", - "destination": "/docs/concepts/more/comparisons/prisma-and-typeorm" - }, - { - "source": "/docs/concepts/overview/why-prisma/api-comparisons/prisma-and-sequelize", - "destination": "/docs/concepts/more/comparisons/prisma-and-sequelize" - }, - { - "source": "/docs/concepts/overview/why-prisma/api-comparisons/prisma-and-mongoose", - "destination": "/docs/concepts/more/comparisons/prisma-and-mongoose" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-sql-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-sql-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-sql-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-sql-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-mysql" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-schema/prisma-schema-file", - "destination": "/docs/reference/tools-and-interfaces/prisma-schema" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-client/api", - "destination": "/docs/reference/tools-and-interfaces/prisma-client" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/should-you-upgrade", - "destination": "/docs/guides/upgrade-from-prisma-1/how-to-upgrade" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-schema/models", - "destination": "/docs/reference/tools-and-interfaces/prisma-schema/data-model" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgresql" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server/sql-server-start-from-scratch", - "destination": "/docs/concepts/components/preview-features/sql-server/sql-server-start-from-scratch-typescript" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/how-to-upgrade", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/schema-incompatibilities", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgres", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/upgrading-nexus-prisma-to-nexus", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-nexus-prisma-to-nexus" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-sdl-first", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-sdl-first" - }, - { - "source": "/docs/guides/upgrade-from-prisma-1/upgrading-a-rest-api", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-a-rest-api" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-schema/prisma-schema-reference", - "destination": "/docs/reference/api-reference/prisma-schema-reference" - }, - { - "source": "/docs/reference/tools-and-interfaces/prisma-cli/command-reference", - "destination": "/docs/reference/api-reference/command-reference" - }, - { - "source": "/docs/reference/database-connectors/database-features", - "destination": "/docs/orm/reference/supported-databases" - }, - { - "source": "/docs/reference/database-connectors/connection-urls", - "destination": "/docs/orm/reference/connection-urls" - }, - { - "source": "/docs/more/supported-databases", - "destination": "/docs/orm/reference/supported-databases" - }, - { - "source": "/docs/reference/tools-and-interfaces/:any*", - "destination": "/docs/concepts/components/:any*" - }, - { - "source": "/docs/reference/database-connectors/:any*", - "destination": "/docs/concepts/database-connectors/:any*" - }, - { - "source": "/docs/reference/more/:any*", - "destination": "/docs/concepts/more/:any*" - }, - { - "source": "/docs/understand-prisma/introduction", - "destination": "/docs/concepts/overview/what-is-prisma" - }, - { - "source": "/docs/understand-prisma/data-modeling", - "destination": "/docs/concepts/overview/what-is-prisma/data-modeling" - }, - { - "source": "/docs/understand-prisma/:any*", - "destination": "/docs/concepts/overview/:any*" - }, - { - "source": "/docs/understand-prisma/api-comparisons/:any*", - "destination": "/docs/concepts/overview/why-prisma/api-comparisons" - }, - { - "source": "/docs/more/:any*", - "destination": "/docs/about/:any*" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-sql", - "destination": "/docs/getting-started/setup-prisma" - }, - { - "source": "/docs/guides/prisma-guides/prisma-migrate-guides", - "destination": "/docs/guides/prisma-guides/add-prisma-migrate-to-a-project" - }, - { - "source": "/docs/guides/prisma-guides/prisma-migrate-guides/add-prisma-migrate-to-a-project", - "destination": "/docs/guides/prisma-guides/add-prisma-migrate-to-a-project" - }, - { - "source": "/docs/concepts/components/prisma-client/distinct", - "destination": "/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#select-distinct" - }, - { - "source": "/docs/concepts/components/prisma-client/configuring-the-prisma-client-api", - "destination": "/docs/concepts/components/prisma-client/generating-prisma-client/customizing-the-prisma-client-api" - }, - { - "source": "/docs/concepts/components/prisma-client/constructor", - "destination": "/docs/reference/api-reference/prisma-client-reference#prismaclient" - }, - { - "source": "/docs/concepts/components/prisma-client/field-selection", - "destination": "/docs/concepts/components/prisma-client/select-fields" - }, - { - "source": "/docs/concepts/components/prisma-client/error-reference", - "destination": "/docs/reference/api-reference/error-reference" - }, - { - "source": "/docs/concepts/components/prisma-client/sorting", - "destination": "/docs/concepts/components/prisma-client/filtering-and-sorting" - }, - { - "source": "/docs/concepts/components/prisma-client/filtering", - "destination": "/docs/concepts/components/prisma-client/filtering-and-sorting" - }, - { - "source": "/docs/concepts/components/prisma-client/aggregations", - "destination": "/docs/concepts/components/prisma-client/aggregation-grouping-summarizing" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-json", - "destination": "/docs/concepts/components/prisma-client/working-with-advanced-types" - }, - { - "source": "/docs/concepts/components/prisma-client/group-by", - "destination": "/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#group-by-preview" - }, - { - "source": "/docs/concepts/components/prisma-client/advanced-usage-of-generated-types", - "destination": "/docs/concepts/components/prisma-client/working-with-generated-types" - }, - { - "source": "/docs/concepts/components/preview-features/native-types/native-types-mappings", - "destination": "/docs/reference/api-reference/prisma-schema-reference#model-field-scalar-types" - }, - { - "source": "/docs/concepts/components/preview-features/native-types", - "destination": "/docs/concepts/components/prisma-schema/data-model#native-types-mapping" - }, - { - "source": "/docs/concepts/components/prisma-client/generating-prisma-client", - "destination": "/docs/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client" - }, - { - "source": "/docs/concepts/components/prisma-client/generating-prisma-client/customizing-the-prisma-client-api", - "destination": "/docs/concepts/components/prisma-client/working-with-prismaclient/use-custom-model-and-field-names" - }, - { - "source": "/docs/concepts/components/prisma-client/connection-management", - "destination": "/docs/concepts/components/prisma-client/working-with-prismaclient/connection-management" - }, - { - "source": "/docs/concepts/components/prisma-client/logging", - "destination": "/docs/concepts/components/prisma-client/working-with-prismaclient/logging" - }, - { - "source": "/docs/concepts/components/prisma-client/error-formatting", - "destination": "/docs/concepts/components/prisma-client/working-with-prismaclient/error-formatting" - }, - { - "source": "/docs/concepts/components/prisma-client/deployment", - "destination": "/docs/guides/deployment/deployment" - }, - { - "source": "/docs/concepts/components/prisma-migrate/prisma-migrate-flows", - "destination": "/docs/concepts/components/prisma-migrate" - }, - { - "source": "/docs/guides/prisma-guides/seed-database", - "destination": "/docs/guides/application-lifecycle/seed-database" - }, - { - "source": "/docs/guides/prisma-guides/add-prisma-migrate-to-a-project", - "destination": "/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project" - }, - { - "source": "/docs/about/creating-bug-reports", - "destination": "/docs/support/creating-bug-reports" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-generated-types", - "destination": "/docs/concepts/components/prisma-client/advanced-type-safety/operating-against-partial-structures-of-model-types" - }, - { - "source": "/docs/reference/utility-types-reference", - "destination": "/docs/reference/api-reference/prisma-client-reference#prismavalidator" - }, - { - "source": "/docs/concepts/components/prisma-client/query-engine", - "destination": "/docs/concepts/components/prisma-engines/query-engine" - }, - { - "source": "/docs/concepts/overview/under-the-hood", - "destination": "/docs/concepts/components/prisma-engines" - }, - { - "source": "/docs/guides/application-lifecycle/add-prisma-migrate-to-a-project", - "destination": "/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project" - }, - { - "source": "/docs/guides/deployment/patching-production", - "destination": "/docs/guides/database/patching-production" - }, - { - "source": "/docs/guides/deployment/production-troubleshooting", - "destination": "/docs/guides/database/production-troubleshooting" - }, - { - "source": "/docs/guides/application-lifecycle/:any*", - "destination": "/docs/guides/database/:any*" - }, - { - "source": "/docs/guides/deployment/deploying-to-azure-functions", - "destination": "/docs/guides/deployment/deployment-guides/deploying-to-azure-functions" - }, - { - "source": "/docs/guides/deployment/deploying-to-heroku", - "destination": "/docs/guides/deployment/deployment-guides/deploying-to-heroku" - }, - { - "source": "/docs/guides/deployment/deploying-to-vercel", - "destination": "/docs/guides/deployment/deployment-guides/deploying-to-vercel" - }, - { - "source": "/docs/guides/deployment/deploying-to-aws-lambda", - "destination": "/docs/guides/deployment/deployment-guides/deploying-to-aws-lambda" - }, - { - "source": "/docs/guides/deployment/deploying-to-netlify", - "destination": "/docs/guides/deployment/deployment-guides/deploying-to-netlify" - }, - { - "source": "/docs/guides/general-guides/database-workflows/cascading-deletes/:any*", - "destination": "/docs/concepts/components/prisma-schema/relations/referential-actions" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/cascading-deletes/:any*", - "destination": "/docs/concepts/components/prisma-schema/relations/referential-actions" - }, - { - "source": "/docs/guides/general-guides/database-workflows/data-validation/:any*", - "destination": "/docs/guides/database/advanced-database-tasks/data-validation/:any*" - }, - { - "source": "/docs/guides/general-guides/database-workflows/sql-views", - "destination": "https://github.com/prisma/prisma/issues/678" - }, - { - "source": "/docs/guides/general-guides/database-workflows/sql-views-postgres", - "destination": "https://github.com/prisma/prisma/issues/678" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/sql-views-postgres", - "destination": "https://github.com/prisma/prisma/issues/678" - }, - { - "source": "/docs/guides/general-guides/database-workflows/sql-views-mysql", - "destination": "https://github.com/prisma/prisma/issues/678" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/sql-views-mysql", - "destination": "https://github.com/prisma/prisma/issues/678" - }, - { - "source": "/docs/guides/general-guides/database-workflows/unique-constraints-and-indexes", - "destination": "/docs/concepts/components/prisma-schema/data-model#defining-a-unique-field" - }, - { - "source": "/docs/guides/general-guides/database-workflows/unique-constraints-and-indexes/mysql", - "destination": "/docs/concepts/components/prisma-schema/data-model#defining-a-unique-field" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/unique-constraints-and-indexes/postgresql", - "destination": "/docs/concepts/components/prisma-schema/data-model#defining-a-unique-field" - }, - { - "source": "/docs/guides/general-guides/database-workflows/unique-constraints-and-indexes/sqlite", - "destination": "/docs/concepts/components/prisma-schema/data-model#defining-a-unique-field" - }, - { - "source": "/docs/guides/general-guides/database-workflows/foreign-keys", - "destination": "/docs/concepts/components/prisma-schema/relations#relational-databases" - }, - { - "source": "/docs/guides/general-guides/database-workflows/foreign-keys/mysql", - "destination": "/docs/concepts/components/prisma-schema/relations#relational-databases" - }, - { - "source": "/docs/guides/general-guides/database-workflows/foreign-keys/postgresql", - "destination": "/docs/concepts/components/prisma-schema/relations#relational-databases" - }, - { - "source": "/docs/guides/general-guides/database-workflows/foreign-keys/sqlite", - "destination": "/docs/concepts/components/prisma-schema/relations#relational-databases" - }, - { - "source": "/docs/guides/prisma-guides/:any*", - "destination": "/docs/guides/performance-and-optimization/:any*" - }, - { - "source": "/docs/mongodb", - "destination": "/docs/concepts/database-connectors/mongodb" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/advanced-migrate-scenarios", - "destination": "/docs/guides/database/developing-with-prisma-migrate/customizing-migrations" - }, - { - "source": "/docs/concepts/components/prisma-migrate/type-mapping", - "destination": "/docs/concepts/components/prisma-migrate/supported-types-and-db-features" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-advanced-types", - "destination": "/docs/concepts/components/prisma-client/working-with-fields" - }, - { - "source": "/docs/concepts/more/codemod", - "destination": "/docs/guides/upgrade-guides/upgrading-versions/codemods" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/connect-your-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/using-prisma-migrate-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/install-prisma-client-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/querying-the-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/next-steps-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/connect-your-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/introspection-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/install-prisma-client-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/querying-the-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/next-steps-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/connect-your-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/using-prisma-migrate-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/install-prisma-client-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/querying-the-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/next-steps-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/connect-your-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/introspection-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/install-prisma-client-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/querying-the-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/next-steps-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/connect-your-database-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/using-prisma-migrate-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/install-prisma-client-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/querying-the-database-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/next-steps-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/connect-your-database-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/introspection-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/install-prisma-client-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/querying-the-database-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/next-steps-typescript-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-typescript-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/connect-your-database-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/using-prisma-migrate-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/install-prisma-client-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/querying-the-database-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/next-steps-node-mysql", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/connect-your-database-node-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/introspection-node-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/install-prisma-client-node-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/querying-the-database-node-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-node-mysql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/next-steps-node-mysql", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-node-mysql" - }, - { - "source": "/docs/concepts/more/environment-variables", - "destination": "/docs/guides/development-environment/environment-variables" - }, - { - "source": "/docs/concepts/more/environment-variables/managing-env-files-and-setting-variables", - "destination": "/docs/guides/development-environment/environment-variables/managing-env-files-and-setting-variables" - }, - { - "source": "/docs/concepts/more/environment-variables/using-multiple-env-files", - "destination": "/docs/guides/development-environment/environment-variables/using-multiple-env-files" - }, - { - "source": "/docs/concepts/more/editor-setup", - "destination": "/docs/guides/development-environment/editor-setup" - }, - { - "source": "/docs/about/about-the-docs", - "destination": "/docs/about/prisma-docs/about-the-docs" - }, - { - "source": "/docs/about/whats-new-in-prisma-docs", - "destination": "/docs/about/prisma-docs/whats-new-in-prisma-docs" - }, - { - "source": "/docs/about/limitations", - "destination": "/docs/about/prisma/limitations" - }, - { - "source": "/docs/about/roadmap", - "destination": "/docs/about/prisma/roadmap" - }, - { - "source": "/docs/about/faq", - "destination": "/docs/about/prisma/faq" - }, - { - "source": "/docs/about/releases", - "destination": "/docs/about/prisma/releases" - }, - { - "source": "/docs/about/example-projects", - "destination": "/docs/about/prisma/example-projects" - }, - { - "source": "/docs/about/style-guide", - "destination": "/docs/about/prisma-docs/style-guide" - }, - { - "source": "/docs/about/style-guide/mdx-examples", - "destination": "/docs/about/prisma-docs/style-guide/mdx-examples" - }, - { - "source": "/docs/about/style-guide/frontmatter", - "destination": "/docs/about/prisma-docs/style-guide/frontmatter" - }, - { - "source": "/docs/about/style-guide/template", - "destination": "/docs/about/prisma-docs/style-guide/template" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server/sql-server-start-from-scratch-typescript", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-sqlserver" - }, - { - "source": "/docs/concepts/database-connectors/microsoft-sql-server", - "destination": "/docs/concepts/database-connectors/sql-server" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server/sql-server-connection-string", - "destination": "/docs/concepts/database-connectors/sql-server" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server/sql-server-local", - "destination": "/docs/concepts/database-connectors/sql-server/sql-server-local" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server/sql-server-docker", - "destination": "/docs/concepts/database-connectors/sql-server/sql-server-docker" - }, - { - "source": "/docs/concepts/components/preview-features/sql-server", - "destination": "/docs/concepts/database-connectors/sql-server" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-to-latest", - "destination": "/docs/guides/upgrade-guides/upgrading-versions" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-to-use-preview-features/enabling-named-constraints", - "destination": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/named-constraints" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/referential-actions/cyclic-referential-actions", - "destination": "/docs/concepts/components/prisma-schema/relations/referential-actions/special-rules-for-referential-actions" - }, - { - "source": "/docs/concepts/components/prisma-schema/index-configuration", - "destination": "/docs/concepts/components/prisma-schema/indexes" - }, - { - "source": "/docs/concepts/components/prisma-data-platform", - "destination": "/docs/concepts/data-platform" - }, - { - "source": "/docs/about/prisma/platform-releases", - "destination": "/docs/concepts/data-platform/about-platform/platform-releases" - }, - { - "source": "/docs/support", - "destination": "/docs/guides/database/troubleshooting-orm" - }, - { - "source": "/docs/support/:any*", - "destination": "/docs/guides/database/troubleshooting-orm/:any*" - }, - { - "source": "/docs/concepts/data-platform", - "destination": "/docs/data-platform" - }, - { - "source": "/docs/concepts/data-platform/:any*", - "destination": "/docs/data-platform/:any*" - }, - { - "source": "/docs/data-platform/about-platform", - "destination": "/docs/data-platform/about" - }, - { - "source": "/docs/data-platform/about-platform/:any*", - "destination": "/docs/data-platform/about/:any*" - }, - { - "source": "/docs/data-platform/about/platform-limits-and-status", - "destination": "/docs/data-platform/about/limits-and-status" - }, - { - "source": "/docs/data-platform/about/platform-releases", - "destination": "/docs/data-platform/about/releases" - }, - { - "source": "/docs/data-platform/accounts", - "destination": "/docs/data-platform/account" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/referential-integrity", - "destination": "/docs/concepts/components/prisma-schema/relations/relation-mode" - }, - { - "source": "/docs/data-platform/billing/early-adopter-plan", - "destination": "/docs/data-platform/billing/plans-and-quotas" - }, - { - "source": "/docs/data-platform/projects/add-project(.*)", - "destination": "/docs/data-platform/projects/create" - }, - { - "source": "/docs/data-platform/members/user-roles", - "destination": "/docs/data-platform/members/roles-permissions" - }, - { - "source": "/docs/data-platform/members/data-collaborators", - "destination": "/docs/data-platform/members/add" - }, - { - "source": "/docs/data-platform/environments/edit-settings/change-database-connection-string", - "destination": "/docs/data-platform/troubleshooting/cannot-change-db-of-env" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/add-prisma-migrate-to-a-project" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/team-development", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/team-development" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/baselining", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/baselining" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/enable-native-database-functions", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/enable-native-database-functions" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/include-unsupported-database-features", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/include-unsupported-database-features" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/customizing-migrations", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/customizing-migrations" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/squashing-migrations", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/squashing-migrations" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/generating-down-migrations", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/generating-down-migrations" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/troubleshooting-development", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/troubleshooting-development" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/deploy-db.png", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/deploy-db.png" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/existing-database.png", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/existing-database.png" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/migrate-team-dev.png", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/migrate-team-dev.png" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/migration-history.png", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/migration-history.png" - }, - { - "source": "/docs/guides/database/developing-with-prisma-migrate/new-dev-db.png", - "destination": "/docs/guides/migrate/developing-with-prisma-migrate/new-dev-db.png" - }, - { - "source": "/docs/guides/database/seed-database", - "destination": "/docs/guides/migrate/seed-database" - }, - { - "source": "/docs/guides/database/prototyping-schema-db-push", - "destination": "/docs/guides/migrate/prototyping-schema-db-push" - }, - { - "source": "/docs/guides/database/patching-production", - "destination": "/docs/guides/migrate/patching-production" - }, - { - "source": "/docs/guides/database/production-troubleshooting", - "destination": "/docs/guides/migrate/production-troubleshooting" - }, - { - "source": "/docs/guides/database/using-prisma-with-planetscale", - "destination": "/docs/guides/database/planetscale" - }, - { - "source": "/docs/guides/database/using-prisma-with-cockroachdb", - "destination": "/docs/guides/database/cockroachdb" - }, - { - "source": "/docs/guides/database/using-prisma-with-mongodb", - "destination": "/docs/guides/database/mongodb" - }, - { - "source": "/docs/guides/database/multi-schema", - "destination": "/docs/guides/other/multi-schema" - }, - { - "source": "/docs/guides/database/prisma-type-system", - "destination": "/docs/guides/other/prisma-type-system" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/creating-bug-reports", - "destination": "/docs/guides/other/troubleshooting-orm/creating-bug-reports" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/autocompletion-in-graphql-resolvers-with-js", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/autocompletion-in-graphql-resolvers-with-js" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/working-with-many-to-many-relations", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/working-with-many-to-many-relations" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/finding-entities-based-on-relation", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/finding-entities-based-on-relation" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-monorepo", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-monorepo" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/pkg-issue", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/pkg-issue" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/comparing-columns-through-raw-queries", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/comparing-columns-through-raw-queries" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/prisma-autocompletion-in-js.png", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/prisma-autocompletion-in-js.png" - }, - { - "source": "/docs/guides/database/troubleshooting-orm/help-articles/unwanted-autocomplete-values-in-vscode.png", - "destination": "/docs/guides/other/troubleshooting-orm/help-articles/unwanted-autocomplete-values-in-vscode.png" - }, - { - "source": "/docs/guides/database/troubleshooting-orm", - "destination": "/docs/guides/other/troubleshooting-orm" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/data-validation/postgresql", - "destination": "/docs/guides/other/advanced-database-tasks/data-validation/postgresql" - }, - { - "source": "/docs/guides/database/advanced-database-tasks/data-validation", - "destination": "/docs/guides/other/advanced-database-tasks/data-validation" - }, - { - "source": "/docs/guides/database/advanced-database-tasks", - "destination": "/docs/guides/other/advanced-database-tasks" - }, - { - "source": "/docs/concepts/components/prisma-cli/installation", - "destination": "/docs/reference/api-reference/command-reference#installation" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/finding-entities-based-on-relation", - "destination": "/docs/concepts/components/prisma-client/relation-queries#filter-on-presence-of-related-records" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/using-prisma-migrate-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/install-prisma-client-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/querying-the-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/next-steps-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-postgres", - "destination": "/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/connect-your-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/introspection-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/baseline-your-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/baseline-your-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/baseline-your-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/baseline-your-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/install-prisma-client-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/querying-the-database-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/evolve-your-schema-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/evolve-your-schema-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/evolve-your-schema-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/evolve-your-schema-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-node-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-postgresql" - }, - { - "source": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-node-postgres", - "destination": "/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-node-postgresql" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgres", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgres", - "destination": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgresql" - }, - { - "source": "/docs/guides/migrate/deployment/deploy-database-changes-with-prisma-migrate", - "destination": "/docs/guides/deployment/deploy-database-changes-with-prisma-migrate" - }, - { - "source": "/docs/guides/deployment/deployment", - "destination": "/docs/guides/deployment/deploy-prisma" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-heroku", - "destination": "/docs/guides/deployment/traditional/deploy-to-heroku" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-koyeb", - "destination": "/docs/guides/deployment/traditional/deploy-to-koyeb" - }, - { - "source": "/docs/guides/deployment/deployment-guides", - "destination": "/docs/guides/deployment/deploy-prisma" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-azure-functions", - "destination": "/docs/guides/deployment/serverless/deploy-to-azure-functions" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-vercel", - "destination": "/docs/guides/deployment/serverless/deploy-to-vercel" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-aws-lambda", - "destination": "/docs/guides/deployment/serverless/deploy-to-aws-lambda" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-netlify", - "destination": "/docs/guides/deployment/serverless/deploy-to-netlify" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-deno-deploy", - "destination": "/docs/guides/deployment/edge/deploy-to-deno-deploy" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers", - "destination": "/docs/guides/deployment/edge/deploy-to-cloudflare-workers" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-migrations-from-a-local-environment", - "destination": "/docs/guides/deployment/deploy-migrations-from-a-local-environment" - }, - { - "source": "/docs/guides/deployment/deployment-guides/caveats-when-deploying-to-aws-platforms", - "destination": "/docs/guides/deployment/caveats-when-deploying-to-aws-platforms" - }, - { - "source": "/docs/guides/deployment/deployment-guides/deploying-to-a-different-os", - "destination": "/docs/guides/deployment/deploy-to-a-different-os" - }, - { - "source": "/docs/guides/deployment/deployment-guides/use-prisma-with-serverless-framework", - "destination": "/docs/guides/deployment/serverless/deploy-to-aws-lambda" - }, - { - "source": "/docs/guides/deployment/use-prisma-with-serverless-framework", - "destination": "/docs/guides/deployment/serverless/deploy-to-aws-lambda" - }, - { - "source": "/docs/data-platform/about/releases", - "destination": "/docs/data-platform/platform-console/maturity-levels" - }, - { - "source": "/docs/data-platform/about/limits-and-status", - "destination": "/docs/data-platform/classic-projects/about/limits-and-status" - }, - { - "source": "/docs/data-platform/about", - "destination": "/docs/data-platform/classic-projects/about" - }, - { - "source": "/docs/data-platform/data-proxy/use-data-proxy", - "destination": "/docs/data-platform/classic-projects/data-proxy/use-data-proxy" - }, - { - "source": "/docs/data-platform/data-proxy/deploy", - "destination": "/docs/data-platform/classic-projects/data-proxy/deploy" - }, - { - "source": "/docs/data-platform/data-proxy/prisma-cli-with-data-proxy", - "destination": "/docs/data-platform/classic-projects/data-proxy/prisma-cli-with-data-proxy" - }, - { - "source": "/docs/data-platform/data-proxy/considerations-limitations", - "destination": "/docs/data-platform/classic-projects/data-proxy/considerations-limitations" - }, - { - "source": "/docs/data-platform/data-proxy", - "destination": "/docs/data-platform/classic-projects/data-proxy" - }, - { - "source": "/docs/data-platform/static-ips", - "destination": "/docs/data-platform/classic-projects/platform/static-ips" - }, - { - "source": "/docs/data-platform/projects/create", - "destination": "/docs/data-platform/classic-projects/platform/projects/create" - }, - { - "source": "/docs/data-platform/projects/edit-settings", - "destination": "/docs/data-platform/classic-projects/platform/projects/edit-settings" - }, - { - "source": "/docs/data-platform/projects/delete-project", - "destination": "/docs/data-platform/classic-projects/platform/projects/delete-project" - }, - { - "source": "/docs/data-platform/projects", - "destination": "/docs/data-platform/classic-projects/platform/projects" - }, - { - "source": "/docs/data-platform/environments/view-all", - "destination": "/docs/data-platform/classic-projects/platform/environments/view-all" - }, - { - "source": "/docs/data-platform/environments/create", - "destination": "/docs/data-platform/classic-projects/platform/environments/create" - }, - { - "source": "/docs/data-platform/environments/edit-settings/edit-name-and-url-handle", - "destination": "/docs/data-platform/classic-projects/platform/environments/edit-settings/edit-name-and-url-handle" - }, - { - "source": "/docs/data-platform/environments/edit-settings/change-default-environment", - "destination": "/docs/data-platform/classic-projects/platform/environments/edit-settings/change-default-environment" - }, - { - "source": "/docs/data-platform/environments/edit-settings", - "destination": "/docs/data-platform/classic-projects/platform/environments/edit-settings" - }, - { - "source": "/docs/data-platform/environments/delete", - "destination": "/docs/data-platform/classic-projects/platform/environments/delete" - }, - { - "source": "/docs/data-platform/environments", - "destination": "/docs/data-platform/classic-projects/platform/environments" - }, - { - "source": "/docs/data-platform/members/roles-permissions", - "destination": "/docs/data-platform/classic-projects/platform/members/roles-permissions" - }, - { - "source": "/docs/data-platform/members/add", - "destination": "/docs/data-platform/classic-projects/platform/members/add" - }, - { - "source": "/docs/data-platform/members/change-role", - "destination": "/docs/data-platform/classic-projects/platform/members/change-role" - }, - { - "source": "/docs/data-platform/members/remove", - "destination": "/docs/data-platform/classic-projects/platform/members/remove" - }, - { - "source": "/docs/data-platform/members", - "destination": "/docs/data-platform/classic-projects/platform/members" - }, - { - "source": "/docs/data-platform/data-browser", - "destination": "/docs/data-platform/classic-projects/platform/data-browser" - }, - { - "source": "/docs/data-platform/query-console", - "destination": "/docs/data-platform/classic-projects/platform/query-console" - }, - { - "source": "/docs/data-platform/schema-viewer", - "destination": "/docs/data-platform/classic-projects/platform/schema-viewer" - }, - { - "source": "/docs/data-platform/account", - "destination": "/docs/data-platform/classic-projects/platform/account" - }, - { - "source": "/docs/data-platform/github-integration", - "destination": "/docs/data-platform/classic-projects/platform/github-integration" - }, - { - "source": "/docs/data-platform/billing/plans-and-quotas", - "destination": "/docs/data-platform/classic-projects/platform/billing/plans-and-quotas" - }, - { - "source": "/docs/data-platform/billing/manage-plans", - "destination": "/docs/data-platform/classic-projects/platform/billing/manage-plans" - }, - { - "source": "/docs/data-platform/billing/invoices", - "destination": "/docs/data-platform/classic-projects/platform/billing/invoices" - }, - { - "source": "/docs/data-platform/billing/data-proxy-usage", - "destination": "/docs/data-platform/classic-projects/platform/billing/data-proxy-usage" - }, - { - "source": "/docs/data-platform/billing/payment-method-and-billing-information", - "destination": "/docs/data-platform/classic-projects/platform/billing/payment-method-and-billing-information" - }, - { - "source": "/docs/data-platform/billing", - "destination": "/docs/data-platform/classic-projects/platform/billing" - }, - { - "source": "/docs/data-platform/troubleshooting/connection-to-db-timed-out", - "destination": "/docs/data-platform/classic-projects/platform/troubleshooting/connection-to-db-timed-out" - }, - { - "source": "/docs/data-platform/troubleshooting/cannot-change-db-of-env", - "destination": "/docs/data-platform/classic-projects/platform/troubleshooting/cannot-change-db-of-env" - }, - { - "source": "/docs/data-platform/troubleshooting/cannot-edit-schema-file", - "destination": "/docs/data-platform/classic-projects/platform/troubleshooting/cannot-edit-schema-file" - }, - { - "source": "/docs/data-platform/troubleshooting/schema-file-does-not-update", - "destination": "/docs/data-platform/classic-projects/platform/troubleshooting/schema-file-does-not-update" - }, - { - "source": "/docs/data-platform/troubleshooting", - "destination": "/docs/data-platform/platform-console/support" - }, - { - "source": "/docs/data-platform/contact-support", - "destination": "/docs/data-platform/platform-console/support" - }, - { - "source": "/docs/data-platform/cloud-projects/platform/account", - "destination": "/docs/data-platform/platform-console/concepts" - }, - { - "source": "/docs/data-platform/cloud-projects/platform/projects", - "destination": "/docs/data-platform/platform-console/concepts/projects" - }, - { - "source": "/docs/data-platform/cloud-projects/platform/organizations", - "destination": "/docs/data-platform/platform-console/concepts/workspaces" - }, - { - "source": "/docs/data-platform/cloud-projects/platform/billing", - "destination": "/docs/data-platform/platform-console/concepts/workspaces" - }, - { - "source": "/docs/data-platform/cloud-projects/platform", - "destination": "/docs/data-platform/platform-console" - }, - { - "source": "/docs/data-platform/cloud-projects/faq", - "destination": "/docs/data-platform/platform-console/limits" - }, - { - "source": "/docs/data-platform/cloud-projects/support", - "destination": "/docs/data-platform/platform-console/support" - }, - { - "source": "/docs/data-platform/cloud-projects/about-cloud-projects", - "destination": "/docs/data-platform/platform-console/about" - }, - { - "source": "/docs/data-platform/cloud-projects", - "destination": "/docs/data-platform/platform-console" - }, - { - "source": "/docs/data-platform/classic-projects/about/releases", - "destination": "/docs/data-platform/platform-console/maturity-levels" - }, - { - "source": "/docs/data-platform/classic-projects/about/limits-and-status", - "destination": "/docs/data-platform/platform-console/limits" - }, - { - "source": "/docs/data-platform/classic-projects/about", - "destination": "/docs/data-platform/platform-console/about" - }, - { - "source": "/docs/data-platform/classic-projects/contact-support", - "destination": "/docs/data-platform/platform-console/support" - }, - { - "source": "/docs/guides/performance-and-optimization/connection-management/configure-pg-bouncer", - "destination": "/docs/guides/performance-and-optimization/connection-management/configure-for-external-connection-pooler" - }, - { - "source": "/docs/data-platform/classic-projects/platform/billing", - "destination": "https://www.prisma.io/pricing" - }, - { - "source": "/docs/data-platform/accelerate/testing", - "destination": "/docs/data-platform/accelerate/evaluating" - }, - { - "source": "/docs/data-platform/classic-projects/platform/billing/plans-and-quotas", - "destination": "https://www.prisma.io/pricing" - }, - { - "source": "/docs/data-platform/classic-projects/platform/billing/manage-plans", - "destination": "https://www.prisma.io/pricing" - }, - { - "source": "/docs/concepts/components/prisma-schema", - "destination": "/docs/orm/prisma-schema" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient", - "destination": "/docs/orm/prisma-client" - }, - { - "source": "/docs/concepts/components/prisma-client/transactions", - "destination": "/docs/orm/prisma-client/queries/transactions" - }, - { - "source": "/docs/concepts/components/prisma-migrate/get-started", - "destination": "/docs/orm/prisma-migrate/getting-started" - }, - { - "source": "/docs/concepts/components/prisma-migrate/db-push", - "destination": "/docs/orm/prisma-migrate/workflows/prototyping-your-schema" - }, - { - "source": "/docs/concepts/components/prisma-cli", - "destination": "/docs/orm/tools/prisma-cli" - }, - { - "source": "/docs/concepts/components/prisma-engines", - "destination": "/docs/orm/more/under-the-hood/engines" - }, - { - "source": "/docs/concepts/database-connectors/mongodb", - "destination": "/docs/orm/" - }, - { - "source": "/docs/concepts/database-connectors", - "destination": "/docs/orm/overview" - }, - { - "source": "/docs/concepts/more/telemetry", - "destination": "/docs/orm/tools/prisma-cli#telemetry" - }, - { - "source": "/docs/concepts/more", - "destination": "/docs/orm/more" - }, - { - "source": "/docs/concepts", - "destination": "/docs/orm" - }, - { - "source": "/docs/concepts/overview/why-prisma", - "destination": "/docs/orm/overview/introduction/why-prisma" - }, - { - "source": "/docs/concepts/overview/should-you-use-prisma", - "destination": "/docs/orm/overview/introduction/should-you-use-prisma" - }, - { - "source": "/docs/concepts/overview/what-is-prisma/data-modeling", - "destination": "/docs/orm/overview/introduction/data-modeling" - }, - { - "source": "/docs/concepts/overview/what-is-prisma", - "destination": "/docs/orm/overview/introduction/what-is-prisma" - }, - { - "source": "/docs/concepts/components/database-drivers", - "destination": "/docs/orm/overview/databases/database-drivers" - }, - { - "source": "/docs/concepts/database-connectors/postgresql", - "destination": "/docs/orm/overview/databases/postgresql" - }, - { - "source": "/docs/concepts/database-connectors/mysql", - "destination": "/docs/orm/overview/databases/mysql" - }, - { - "source": "/docs/concepts/database-connectors/sqlite", - "destination": "/docs/orm/overview/databases/sqlite" - }, - { - "source": "/docs/guides/database/mongodb", - "destination": "/docs/orm/overview/databases/mongodb" - }, - { - "source": "/docs/concepts/database-connectors/cockroachdb", - "destination": "/docs/orm/overview/databases/cockroachdb" - }, - { - "source": "/docs/concepts/database-connectors/sql-server/sql-server-local", - "destination": "/docs/orm/overview/databases/sql-server/sql-server-local" - }, - { - "source": "/docs/concepts/database-connectors/sql-server/sql-server-docker", - "destination": "/docs/orm/overview/databases/sql-server/sql-server-docker" - }, - { - "source": "/docs/concepts/database-connectors/sql-server", - "destination": "/docs/orm/overview/databases/sql-server" - }, - { - "source": "/docs/guides/database/planetscale", - "destination": "/docs/orm/overview/databases/planetscale" - }, - { - "source": "/docs/guides/database/cockroachdb", - "destination": "/docs/orm/overview/databases/cockroachdb" - }, - { - "source": "/docs/guides/database/supabase", - "destination": "/docs/orm/overview/databases/supabase" - }, - { - "source": "/docs/guides/database/neon", - "destination": "/docs/orm/overview/databases/neon" - }, - { - "source": "/docs/guides/database/turso", - "destination": "/docs/orm/overview/databases/turso" - }, - { - "source": "/docs/guides/database/images/embedded-replica-create-replica.png", - "destination": "/docs/orm/overview/databases/images/embedded-replica-create-replica.png" - }, - { - "source": "/docs/guides/database/images/embedded-replica-read.png", - "destination": "/docs/orm/overview/databases/images/embedded-replica-read.png" - }, - { - "source": "/docs/guides/database/images/embedded-replica-remote-read.png", - "destination": "/docs/orm/overview/databases/images/embedded-replica-remote-read.png" - }, - { - "source": "/docs/guides/database/images/embedded-replica-write-propagation.png", - "destination": "/docs/orm/overview/databases/images/embedded-replica-write-propagation.png" - }, - { - "source": "/docs/concepts/database-connectors/mongodb.png", - "destination": "/docs/orm/overview/databases/mongodb.png" - }, - { - "source": "/docs/concepts/database-connectors/mysql-connection-string.png", - "destination": "/docs/orm/overview/databases/mysql-connection-string.png" - }, - { - "source": "/docs/concepts/database-connectors/postgresql-connection-string.png", - "destination": "/docs/orm/overview/databases/postgresql-connection-string.png" - }, - { - "source": "/docs/concepts/overview/node-js-db-tools-tradeoffs.png", - "destination": "/docs/orm/overview/introduction/node-js-db-tools-tradeoffs.png" - }, - { - "source": "/docs/concepts/overview/prisma-makes-devs-productive.png", - "destination": "/docs/orm/overview/introduction/prisma-makes-devs-productive.png" - }, - { - "source": "/docs/concepts/overview/prisma-rest-apis.png", - "destination": "/docs/orm/overview/introduction/prisma-rest-apis.png" - }, - { - "source": "/docs/concepts/overview/user-post-relation-1-n.png", - "destination": "/docs/orm/overview/introduction/user-post-relation-1-n.png" - }, - { - "source": "/docs/concepts/overview/user-table.png", - "destination": "/docs/orm/overview/introduction/user-table.png" - }, - { - "source": "/docs/concepts/overview/user-table.svg", - "destination": "/docs/orm/overview/introduction/user-table.svg" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/rest.md", - "destination": "/docs/orm/overview/prisma-in-your-stack/rest.md" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/graphql.md", - "destination": "/docs/orm/overview/prisma-in-your-stack/graphql.md" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/fullstack", - "destination": "/docs/orm/overview/prisma-in-your-stack/fullstack" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/is-prisma-an-orm", - "destination": "/docs/orm/overview/prisma-in-your-stack/is-prisma-an-orm" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack", - "destination": "/docs/orm/overview/prisma-in-your-stack" - }, - { - "source": "/docs/concepts/overview", - "destination": "/docs/orm/overview" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client", - "destination": "/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client", - "destination": "/docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-client" - }, - { - "source": "/docs/concepts/components/prisma-client/read-replicas", - "destination": "/docs/orm/prisma-client/setup-and-configuration/read-replicas" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/use-custom-model-and-field-names", - "destination": "/docs/orm/prisma-client/setup-and-configuration/custom-model-and-field-names" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/logging", - "destination": "/docs/orm/prisma-client/observability-and-logging/logging" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/error-formatting", - "destination": "/docs/orm/prisma-client/setup-and-configuration/error-formatting" - }, - { - "source": "/docs/concepts/components/prisma-client/database-polyfills", - "destination": "/docs/orm/prisma-client/setup-and-configuration/database-polyfills" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/connection-management", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-management" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/connection-pool", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool" - }, - { - "source": "/docs/guides/performance-and-optimization/connection-management/configure-for-external-connection-pooler", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections/pgbouncer" - }, - { - "source": "/docs/guides/performance-and-optimization/connection-management", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections" - }, - { - "source": "/docs/guides/performance-and-optimization/connection-management/serverless-connections-2.png", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections/serverless-connections-2.png" - }, - { - "source": "/docs/guides/performance-and-optimization/connection-management/serverless-connections.png", - "destination": "/docs/orm/prisma-client/setup-and-configuration/databases-connections/serverless-connections.png" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/prisma-client-generation-workflow.png", - "destination": "/docs/orm/prisma-client/setup-and-configuration/prisma-client-generation-workflow.png" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/prisma-client-node-module.png", - "destination": "/docs/orm/prisma-client/setup-and-configuration/prisma-client-node-module.png" - }, - { - "source": "/docs/concepts/components/prisma-client/crud", - "destination": "/docs/orm/prisma-client/queries/crud" - }, - { - "source": "/docs/concepts/components/prisma-client/select-fields", - "destination": "/docs/orm/prisma-client/queries/select-fields" - }, - { - "source": "/docs/concepts/components/prisma-client/relation-queries", - "destination": "/docs/orm/prisma-client/queries/relation-queries" - }, - { - "source": "/docs/concepts/components/prisma-client/filtering-and-sorting", - "destination": "/docs/orm/prisma-client/queries/filtering-and-sorting" - }, - { - "source": "/docs/concepts/components/prisma-client/pagination", - "destination": "/docs/orm/prisma-client/queries/pagination" - }, - { - "source": "/docs/concepts/components/prisma-client/aggregation-grouping-summarizing", - "destination": "/docs/orm/prisma-client/queries/aggregation-grouping-summarizing" - }, - { - "source": "/docs/guides/performance-and-optimization/prisma-client-transactions-guide", - "destination": "/docs/orm/prisma-client/queries/transactions" - }, - { - "source": "/docs/concepts/components/prisma-client/full-text-search", - "destination": "/docs/orm/prisma-client/queries/full-text-search" - }, - { - "source": "/docs/concepts/components/prisma-client/custom-validation", - "destination": "/docs/orm/prisma-client/queries/custom-validation" - }, - { - "source": "/docs/concepts/components/prisma-client/computed-fields", - "destination": "/docs/orm/prisma-client/queries/computed-fields" - }, - { - "source": "/docs/concepts/components/prisma-client/excluding-fields", - "destination": "/docs/orm/prisma-client/queries/excluding-fields" - }, - { - "source": "/docs/concepts/components/prisma-client/custom-models", - "destination": "/docs/orm/prisma-client/queries/custom-models" - }, - { - "source": "/docs/concepts/components/prisma-client/case-sensitivity", - "destination": "/docs/orm/prisma-client/queries/case-sensitivity" - }, - { - "source": "/docs/concepts/components/prisma-client/raw-database-access", - "destination": "/docs/orm/prisma-client/queries/raw-database-access/raw-queries" - }, - { - "source": "/docs/guides/other/advanced-database-tasks/typesafe-raw-sql/safeql", - "destination": "/docs/orm/prisma-client/queries/raw-database-access/custom-and-type-safe-queries" - }, - { - "source": "/docs/guides/performance-and-optimization/query-optimization-performance", - "destination": "/docs/orm/prisma-client/queries/query-optimization-performance" - }, - { - "source": "/docs/concepts/components/prisma-client/composite-types", - "destination": "/docs/orm/prisma-client/special-fields-and-types/composite-types" - }, - { - "source": "/docs/concepts/components/prisma-client/null-and-undefined", - "destination": "/docs/orm/prisma-client/special-fields-and-types/null-and-undefined" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields", - "destination": "/docs/orm/prisma-client/special-fields-and-types/working-with-json-fields" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-fields/working-with-scalar-lists-arrays", - "destination": "/docs/orm/prisma-client/special-fields-and-types/working-with-scalar-lists-arrays" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-fields/working-with-composite-ids-and-constraints", - "destination": "/docs/orm/prisma-client/special-fields-and-types/working-with-composite-ids-and-constraints" - }, - { - "source": "/docs/concepts/components/prisma-client/working-with-fields", - "destination": "/docs/orm/prisma-client/special-fields-and-types" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/model", - "destination": "/docs/orm/prisma-client/client-extensions/model" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/client", - "destination": "/docs/orm/prisma-client/client-extensions/client" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/query", - "destination": "/docs/orm/prisma-client/client-extensions/query" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/result", - "destination": "/docs/orm/prisma-client/client-extensions/result" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/shared-extensions", - "destination": "/docs/orm/prisma-client/client-extensions/shared-extensions" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/type-utilities", - "destination": "/docs/orm/prisma-client/client-extensions/type-utilities" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions/extension-examples", - "destination": "/docs/orm/prisma-client/client-extensions/extension-examples" - }, - { - "source": "/docs/concepts/components/prisma-client/middleware/soft-delete-middleware", - "destination": "/docs/orm/prisma-client/client-extensions/middleware/soft-delete-middleware" - }, - { - "source": "/docs/concepts/components/prisma-client/middleware/logging-middleware", - "destination": "/docs/orm/prisma-client/client-extensions/middleware/logging-middleware" - }, - { - "source": "/docs/concepts/components/prisma-client/middleware/session-data-middleware", - "destination": "/docs/orm/prisma-client/client-extensions/middleware/session-data-middleware" - }, - { - "source": "/docs/concepts/components/prisma-client/middleware", - "destination": "/docs/orm/prisma-client/client-extensions/middleware" - }, - { - "source": "/docs/concepts/components/prisma-client/client-extensions", - "destination": "/docs/orm/prisma-client/client-extensions" - }, - { - "source": "/docs/concepts/components/prisma-client/advanced-type-safety/operating-against-partial-structures-of-model-types", - "destination": "/docs/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types" - }, - { - "source": "/docs/guides/other/prisma-type-system", - "destination": "/docs/orm/prisma-client/type-safety/prisma-type-system" - }, - { - "source": "/docs/concepts/components/prisma-client/advanced-type-safety/prisma-validator", - "destination": "/docs/orm/prisma-client/type-safety/prisma-validator" - }, - { - "source": "/docs/concepts/components/prisma-client/advanced-type-safety", - "destination": "/docs/orm/prisma-client/type-safety" - }, - { - "source": "/docs/guides/testing/unit-testing", - "destination": "/docs/orm/prisma-client/testing/unit-testing" - }, - { - "source": "/docs/guides/testing/integration-testing", - "destination": "/docs/orm/prisma-client/testing/integration-testing" - }, - { - "source": "/docs/guides/testing/Docker_Diagram_V1.png", - "destination": "/docs/orm/prisma-client/testing/Docker_Diagram_V1.png" - }, - { - "source": "/docs/guides/testing", - "destination": "/docs/orm/prisma-client/testing" - }, - { - "source": "/docs/guides/deployment/deploy-prisma", - "destination": "/docs/orm/prisma-client/deployment/deploy-prisma" - }, - { - "source": "/docs/guides/deployment/traditional/deploy-to-heroku", - "destination": "/docs/orm/prisma-client/deployment/traditional/deploy-to-heroku" - }, - { - "source": "/docs/guides/deployment/traditional/deploy-to-koyeb", - "destination": "/docs/orm/prisma-client/deployment/traditional/deploy-to-koyeb" - }, - { - "source": "/docs/guides/deployment/traditional/images/heroku-architecture.png", - "destination": "/docs/orm/prisma-client/deployment/traditional/images/heroku-architecture.png" - }, - { - "source": "/docs/guides/deployment/traditional/images/heroku-deployed.png", - "destination": "/docs/orm/prisma-client/deployment/traditional/images/heroku-deployed.png" - }, - { - "source": "/docs/guides/deployment/traditional/images/koyeb-app-creation.png", - "destination": "/docs/orm/prisma-client/deployment/traditional/images/koyeb-app-creation.png" - }, - { - "source": "/docs/guides/deployment/traditional/images/koyeb-architecture.png", - "destination": "/docs/orm/prisma-client/deployment/traditional/images/koyeb-architecture.png" - }, - { - "source": "/docs/guides/deployment/traditional/images/koyeb-deployed.png", - "destination": "/docs/orm/prisma-client/deployment/traditional/images/koyeb-deployed.png" - }, - { - "source": "/docs/guides/deployment/traditional", - "destination": "/docs/orm/prisma-client/deployment/traditional" - }, - { - "source": "/docs/guides/deployment/serverless/deploy-to-azure-functions", - "destination": "/docs/orm/prisma-client/deployment/serverless/deploy-to-azure-functions" - }, - { - "source": "/docs/guides/deployment/serverless/deploy-to-vercel", - "destination": "/docs/orm/prisma-client/deployment/serverless/deploy-to-vercel" - }, - { - "source": "/docs/guides/deployment/serverless/deploy-to-aws-lambda", - "destination": "/docs/orm/prisma-client/deployment/serverless/deploy-to-aws-lambda" - }, - { - "source": "/docs/guides/deployment/serverless/deploy-to-netlify", - "destination": "/docs/orm/prisma-client/deployment/serverless/deploy-to-netlify" - }, - { - "source": "/docs/guides/deployment/serverless/images/00-deploy-to-vercel-architecture.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/00-deploy-to-vercel-architecture.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/10-deploy-to-vercel-deploy-button.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/10-deploy-to-vercel-deploy-button.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/10-deploy-to-vercel-deploy-button.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/10-deploy-to-vercel-deploy-button.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/20-deploy-to-vercel-select-github.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/20-deploy-to-vercel-select-github.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/20-deploy-to-vercel-select-github.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/20-deploy-to-vercel-select-github.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/30-deploy-to-vercel-create-git-repo.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/30-deploy-to-vercel-create-git-repo.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/30-deploy-to-vercel-create-git-repo.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/30-deploy-to-vercel-create-git-repo.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/40-deploy-to-vercel-configure-project.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/40-deploy-to-vercel-configure-project.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/40-deploy-to-vercel-configure-project.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/40-deploy-to-vercel-configure-project.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/50-deploy-to-vercel-success.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/50-deploy-to-vercel-success.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/50-deploy-to-vercel-success.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/50-deploy-to-vercel-success.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/60-deploy-to-vercel-preview-environment-variable.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/60-deploy-to-vercel-preview-environment-variable.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/60-deploy-to-vercel-preview-environment-variable.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/60-deploy-to-vercel-preview-environment-variable.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/70-deploy-to-vercel-environment-variables.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/70-deploy-to-vercel-environment-variables.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/70-deploy-to-vercel-environment-variables.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/70-deploy-to-vercel-environment-variables.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/01-deploy-to-netlify-architecture.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/01-deploy-to-netlify-architecture.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/02-deploy-to-netlify-example-repo-click-fork.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/02-deploy-to-netlify-example-repo-click-fork.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/02-deploy-to-netlify-example-repo-click-fork.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/02-deploy-to-netlify-example-repo-click-fork.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/03-deploy-to-netlify-example-repo-create-fork-page.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/03-deploy-to-netlify-example-repo-create-fork-page.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/03-deploy-to-netlify-example-repo-create-fork-page.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/03-deploy-to-netlify-example-repo-create-fork-page.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/04-deploy-to-netlify-copy-supabase-connection-string.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/04-deploy-to-netlify-copy-supabase-connection-string.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/04-deploy-to-netlify-copy-supabase-connection-string.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/04-deploy-to-netlify-copy-supabase-connection-string.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/05-deploy-to-netlify-netlify-init-configure-site.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/05-deploy-to-netlify-netlify-init-configure-site.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/05-deploy-to-netlify-netlify-init-configure-site.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/05-deploy-to-netlify-netlify-init-configure-site.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/06-deploy-to-netlify-site-settings.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/06-deploy-to-netlify-site-settings.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/06-deploy-to-netlify-site-settings.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/06-deploy-to-netlify-site-settings.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/07-deploy-to-netlify-environment-variables-settings.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/07-deploy-to-netlify-environment-variables-settings.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/07-deploy-to-netlify-environment-variables-settings.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/07-deploy-to-netlify-environment-variables-settings.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/08-deploy-to-netlify-application-deployed.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/08-deploy-to-netlify-application-deployed.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/08-deploy-to-netlify-application-deployed.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/08-deploy-to-netlify-application-deployed.snagx" - }, - { - "source": "/docs/guides/deployment/serverless/images/09-deploy-to-netlify-application-deployed-call-result.png", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/09-deploy-to-netlify-application-deployed-call-result.png" - }, - { - "source": "/docs/guides/deployment/serverless/images/09-deploy-to-netlify-application-deployed-call-result.snagx", - "destination": "/docs/orm/prisma-client/deployment/serverless/images/09-deploy-to-netlify-application-deployed-call-result.snagx" - }, - { - "source": "/docs/guides/deployment/serverless", - "destination": "/docs/orm/prisma-client/deployment/serverless" - }, - { - "source": "/docs/concepts/components/prisma-client/module-bundlers", - "destination": "/docs/orm/prisma-client/deployment/module-bundlers" - }, - { - "source": "/docs/guides/deployment/edge/deploy-to-cloudflare-workers", - "destination": "/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare-workers" - }, - { - "source": "/docs/guides/deployment/edge/deploy-to-deno-deploy", - "destination": "/docs/orm/prisma-client/deployment/edge/deploy-to-deno-deploy" - }, - { - "source": "/docs/guides/deployment/edge/images/03-import-project.png", - "destination": "/docs/orm/prisma-client/deployment/edge/images/03-import-project.png" - }, - { - "source": "/docs/guides/deployment/edge/images/03-import-project.snagx", - "destination": "/docs/orm/prisma-client/deployment/edge/images/03-import-project.snagx" - }, - { - "source": "/docs/guides/deployment/edge/images/04-connect-db.png", - "destination": "/docs/orm/prisma-client/deployment/edge/images/04-connect-db.png" - }, - { - "source": "/docs/guides/deployment/edge/images/04-connect-db.snagx", - "destination": "/docs/orm/prisma-client/deployment/edge/images/04-connect-db.snagx" - }, - { - "source": "/docs/guides/deployment/edge/images/05-data-proxy.png", - "destination": "/docs/orm/prisma-client/deployment/edge/images/05-data-proxy.png" - }, - { - "source": "/docs/guides/deployment/edge/images/05-data-proxy.snagx", - "destination": "/docs/orm/prisma-client/deployment/edge/images/05-data-proxy.snagx" - }, - { - "source": "/docs/guides/deployment/edge/images/01-create-repo.png", - "destination": "/docs/orm/prisma-client/deployment/edge/images/01-create-repo.png" - }, - { - "source": "/docs/guides/deployment/edge/images/02-deploy-to-deno-project-parameters.png", - "destination": "/docs/orm/prisma-client/deployment/edge/images/02-deploy-to-deno-project-parameters.png" - }, - { - "source": "/docs/guides/deployment/edge/images/02-deploy-to-deno-project-parameters.snagx", - "destination": "/docs/orm/prisma-client/deployment/edge/images/02-deploy-to-deno-project-parameters.snagx" - }, - { - "source": "/docs/guides/deployment/edge", - "destination": "/docs/orm/prisma-client/deployment/edge" - }, - { - "source": "/docs/guides/deployment/deploy-database-changes-with-prisma-migrate", - "destination": "/docs/orm/prisma-client/deployment/deploy-database-changes-with-prisma-migrate" - }, - { - "source": "/docs/guides/deployment/deploy-migrations-from-a-local-environment", - "destination": "/docs/orm/prisma-client/deployment/deploy-migrations-from-a-local-environment" - }, - { - "source": "/docs/guides/deployment/caveats-when-deploying-to-aws-platforms", - "destination": "/docs/orm/prisma-client/deployment/caveats-when-deploying-to-aws-platforms" - }, - { - "source": "/docs/guides/deployment/deploy-to-a-different-os", - "destination": "/docs/orm/prisma-client/deployment/deploy-to-a-different-os" - }, - { - "source": "/docs/guides/deployment", - "destination": "/docs/orm/prisma-client/deployment" - }, - { - "source": "/docs/concepts/components/prisma-client/metrics", - "destination": "/docs/orm/prisma-client/observability-and-logging/metrics" - }, - { - "source": "/docs/concepts/components/prisma-client/opentelemetry-tracing", - "destination": "/docs/orm/prisma-client/observability-and-logging/opentelemetry-tracing" - }, - { - "source": "/docs/concepts/components/prisma-client/jaeger.png", - "destination": "/docs/orm/prisma-client/observability-and-logging/jaeger.png" - }, - { - "source": "/docs/concepts/components/prisma-client/trace-diagram.png", - "destination": "/docs/orm/prisma-client/observability-and-logging/trace-diagram.png" - }, - { - "source": "/docs/concepts/components/prisma-client/debugging", - "destination": "/docs/orm/prisma-client/debugging-and-troubleshooting/debugging" - }, - { - "source": "/docs/concepts/components/prisma-client/handling-exceptions-and-errors", - "destination": "/docs/orm/prisma-client/debugging-and-troubleshooting/handling-exceptions-and-errors" - }, - { - "source": "/docs/concepts/components/prisma-client", - "destination": "/docs/orm/prisma-client" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/add-prisma-migrate-to-a-project", - "destination": "/docs/orm/prisma-migrate/getting-started" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model" - }, - { - "source": "/docs/concepts/components/prisma-migrate/migration-histories", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/migration-histories" - }, - { - "source": "/docs/concepts/components/prisma-migrate/shadow-database", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database" - }, - { - "source": "/docs/concepts/components/prisma-migrate/prisma-migrate-limitations-issues", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/limitations-and-known-issues" - }, - { - "source": "/docs/concepts/components/prisma-migrate/legacy-migrate", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/legacy-migrate" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/database-first-migration-flow.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/database-first-migration-flow.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/db-push-flow.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/db-push-flow.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/entity-first-migration-flow.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/entity-first-migration-flow.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/prisma-migrate-dev-flow.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/prisma-migrate-dev-flow.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/prisma-migrate-diff-flow.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/prisma-migrate-diff-flow.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/prisma-migrate-lifecycle.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/prisma-migrate-lifecycle.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/mental-model-illustrations/prisma-migrate-state-mgt.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/mental-model-illustrations/prisma-migrate-state-mgt.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/migrate-mapping.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/migrate-mapping.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/shadow-database.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate/shadow-db.png", - "destination": "/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-db.png" - }, - { - "source": "/docs/guides/migrate/seed-database", - "destination": "/docs/orm/prisma-migrate/workflows/seeding" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/team-development", - "destination": "/docs/orm/prisma-migrate/workflows/team-development" - }, - { - "source": "/docs/concepts/components/prisma-migrate/supported-types-and-db-features", - "destination": "/docs/orm/prisma-migrate/workflows/native-database-types" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/enable-native-database-functions", - "destination": "/docs/orm/prisma-migrate/workflows/native-database-functions" - }, - { - "source": "/docs/guides/migrate/prototyping-schema-db-push", - "destination": "/docs/orm/prisma-migrate/workflows/prototyping-your-schema" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/troubleshooting-development", - "destination": "/docs/orm/prisma-migrate/workflows/troubleshooting" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/baselining", - "destination": "/docs/orm/prisma-migrate/workflows/baselining" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/customizing-migrations", - "destination": "/docs/orm/prisma-migrate/workflows/customizing-migrations" - }, - { - "source": "/docs/guides/migrate/data-migration", - "destination": "/docs/orm/prisma-migrate/workflows/data-migration" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/squashing-migrations", - "destination": "/docs/orm/prisma-migrate/workflows/squashing-migrations" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/generating-down-migrations", - "destination": "/docs/orm/prisma-migrate/workflows/generating-down-migrations" - }, - { - "source": "/docs/guides/migrate/production-troubleshooting", - "destination": "/docs/orm/prisma-migrate/workflows/patching-and-hotfixing" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/include-unsupported-database-features", - "destination": "/docs/orm/prisma-migrate/workflows/unsupported-database-features" - }, - { - "source": "/docs/concepts/components/prisma-migrate/migrate-development-production", - "destination": "/docs/orm/prisma-migrate/workflows/development-and-production" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/deploy-db.png", - "destination": "/docs/orm/prisma-migrate/workflows/deploy-db.png" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/existing-database.png", - "destination": "/docs/orm/prisma-migrate/workflows/existing-database.png" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/migrate-team-dev.png", - "destination": "/docs/orm/prisma-migrate/workflows/migrate-team-dev.png" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/migration-history.png", - "destination": "/docs/orm/prisma-migrate/workflows/migration-history.png" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate/new-dev-db.png", - "destination": "/docs/orm/prisma-migrate/workflows/new-dev-db.png" - }, - { - "source": "/docs/concepts/components/prisma-migrate", - "destination": "/docs/orm/prisma-migrate" - }, - { - "source": "/docs/concepts/components/prisma-schema/data-sources", - "destination": "/docs/orm/prisma-schema/overview/data-sources" - }, - { - "source": "/docs/concepts/components/prisma-schema/generators", - "destination": "/docs/orm/prisma-schema/overview/generators" - }, - { - "source": "/docs/concepts/components/prisma-schema/data-model", - "destination": "/docs/orm/prisma-schema/data-model/models" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/one-to-one-relations", - "destination": "/docs/orm/prisma-schema/data-model/relations/one-to-one-relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/one-to-many-relations", - "destination": "/docs/orm/prisma-schema/data-model/relations/one-to-many-relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/many-to-many-relations", - "destination": "/docs/orm/prisma-schema/data-model/relations/many-to-many-relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/self-relations", - "destination": "/docs/orm/prisma-schema/data-model/relations/self-relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/referential-actions/special-rules-for-referential-actions", - "destination": "/docs/orm/prisma-schema/data-model/relations/referential-actions/special-rules-for-referential-actions" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/referential-actions", - "destination": "/docs/orm/prisma-schema/data-model/relations/referential-actions" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/relation-mode", - "destination": "/docs/orm/prisma-schema/data-model/relations/relation-mode" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/troubleshooting-relations", - "destination": "/docs/orm/prisma-schema/data-model/relations/troubleshooting-relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations", - "destination": "/docs/orm/prisma-schema/data-model/relations" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/one-to-many.png", - "destination": "/docs/orm/prisma-schema/data-model/relations/one-to-many.png" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/quick-fix-index.png", - "destination": "/docs/orm/prisma-schema/data-model/relations/quick-fix-index.png" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/quick-fix-index.snagx", - "destination": "/docs/orm/prisma-schema/data-model/relations/quick-fix-index.snagx" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/relations-intro.png", - "destination": "/docs/orm/prisma-schema/data-model/relations/relations-intro.png" - }, - { - "source": "/docs/concepts/components/prisma-schema/relations/sample-schema.png", - "destination": "/docs/orm/prisma-schema/data-model/relations/sample-schema.png" - }, - { - "source": "/docs/concepts/components/prisma-schema/indexes", - "destination": "/docs/orm/prisma-schema/data-model/indexes" - }, - { - "source": "/docs/concepts/components/prisma-schema/views", - "destination": "/docs/orm/prisma-schema/data-model/views" - }, - { - "source": "/docs/concepts/components/prisma-schema/names-in-underlying-database", - "destination": "/docs/orm/prisma-schema/data-model/database-mapping" - }, - { - "source": "/docs/guides/other/multi-schema", - "destination": "/docs/orm/prisma-schema/data-model/multi-schema" - }, - { - "source": "/docs/concepts/components/prisma-schema/features-without-psl-equivalent", - "destination": "/docs/orm/prisma-schema/data-model/unsupported-database-features" - }, - { - "source": "/docs/concepts/components/introspection", - "destination": "/docs/orm/prisma-schema/introspection" - }, - { - "source": "/docs/concepts/components/prisma-schema/postgresql-extensions", - "destination": "/docs/orm/prisma-schema/postgresql-extensions" - }, - { - "source": "/docs/concepts/components/prisma-schema/prisma-schema/relations-intro.png", - "destination": "/docs/orm/prisma-schema/prisma-schema/relations-intro.png" - }, - { - "source": "/docs/concepts/components/prisma-schema/prisma-schema/sample-database.png", - "destination": "/docs/orm/prisma-schema/prisma-schema/sample-database.png" - }, - { - "source": "/docs/concepts/components/prisma-studio", - "destination": "/docs/orm/tools/prisma-studio" - }, - { - "source": "/docs/concepts/components/images/drivers/qe-query-engine-adapter.png", - "destination": "/docs/orm/tools/images/drivers/qe-query-engine-adapter.png" - }, - { - "source": "/docs/concepts/components/images/drivers/qe-query-execution-flow.png", - "destination": "/docs/orm/tools/images/drivers/qe-query-execution-flow.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/models-view.png", - "destination": "/docs/orm/tools/images/prisma-studio/models-view.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/open-close-models.png", - "destination": "/docs/orm/tools/images/prisma-studio/open-close-models.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/model-view-keyboard-shortcuts.png", - "destination": "/docs/orm/tools/images/prisma-studio/model-view-keyboard-shortcuts.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/save-multiple-changes.png", - "destination": "/docs/orm/tools/images/prisma-studio/save-multiple-changes.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/add-remove-filters.png", - "destination": "/docs/orm/tools/images/prisma-studio/add-remove-filters.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/show-hide-fields.png", - "destination": "/docs/orm/tools/images/prisma-studio/show-hide-fields.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/show-hide-records.png", - "destination": "/docs/orm/tools/images/prisma-studio/show-hide-records.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/model-sort.png", - "destination": "/docs/orm/tools/images/prisma-studio/model-sort.png" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/array.svg", - "destination": "/docs/orm/tools/images/prisma-studio/array.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/boolean.svg", - "destination": "/docs/orm/tools/images/prisma-studio/boolean.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/database.svg", - "destination": "/docs/orm/tools/images/prisma-studio/database.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/datetime.svg", - "destination": "/docs/orm/tools/images/prisma-studio/datetime.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/enum.svg", - "destination": "/docs/orm/tools/images/prisma-studio/enum.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/number.svg", - "destination": "/docs/orm/tools/images/prisma-studio/number.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/object.svg", - "destination": "/docs/orm/tools/images/prisma-studio/object.svg" - }, - { - "source": "/docs/concepts/components/images/prisma-studio/string.svg", - "destination": "/docs/orm/tools/images/prisma-studio/string.svg" - }, - { - "source": "/docs/concepts/components", - "destination": "/docs/orm/tools" - }, - { - "source": "/docs/reference/api-reference/prisma-client-reference", - "destination": "/docs/orm/reference/prisma-client-reference" - }, - { - "source": "/docs/reference/api-reference/prisma-schema-reference", - "destination": "/docs/orm/reference/prisma-schema-reference" - }, - { - "source": "/docs/reference/api-reference/command-reference", - "destination": "/docs/orm/reference/prisma-cli-reference" - }, - { - "source": "/docs/reference/api-reference/error-reference", - "destination": "/docs/orm/reference/error-reference" - }, - { - "source": "/docs/reference/api-reference/environment-variables-reference", - "destination": "/docs/orm/reference/environment-variables-reference" - }, - { - "source": "/docs/reference/database-reference/database-features", - "destination": "/docs/orm/reference/database-features" - }, - { - "source": "/docs/reference/database-reference/supported-databases", - "destination": "/docs/orm/reference/supported-databases" - }, - { - "source": "/docs/reference/database-reference/connection-urls", - "destination": "/docs/orm/reference/connection-urls" - }, - { - "source": "/docs/reference/system-requirements", - "destination": "/docs/orm/reference/system-requirements" - }, - { - "source": "/docs/concepts/components/preview-features/client-preview-features", - "destination": "/docs/orm/reference/preview-features/client-preview-features" - }, - { - "source": "/docs/concepts/components/preview-features/cli-preview-features", - "destination": "/docs/orm/reference/preview-features/cli-preview-features" - }, - { - "source": "/docs/concepts/components/preview-features", - "destination": "/docs/orm/reference/preview-features" - }, - { - "source": "/docs/reference", - "destination": "/docs/orm/reference" - }, - { - "source": "/docs/concepts/components/prisma-engines/query-engine", - "destination": "/docs/orm/more/under-the-hood/engines" - }, - { - "source": "/docs/concepts/components/prisma-engines/query-engine-node-js-at-runtime.png", - "destination": "/docs/orm/more/under-the-hood/query-engine-node-js-at-runtime.png" - }, - { - "source": "/docs/concepts/components/prisma-engines/typical-flow-query-engine-at-runtime.png", - "destination": "/docs/orm/more/under-the-hood/typical-flow-query-engine-at-runtime.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5/rejectonnotfound-changes", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-5/rejectonnotfound-changes" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5/jsonprotocol-changes", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-5/jsonprotocol-changes" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-5" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-4", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-4" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/named-constraints", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/named-constraints" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/referential-actions", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/referential-actions" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-3", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-3" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions/codemods", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions/codemods" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-versions", - "destination": "/docs/orm/more/upgrade-guides/upgrading-versions" - }, - { - "source": "/docs/guides/upgrade-guides/upgrading-to-use-preview-features", - "destination": "/docs/orm/more/upgrade-guides/upgrading-to-use-preview-features" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/how-to-upgrade" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-nexus-prisma-to-nexus", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-nexus-prisma-to-nexus" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-sdl-first", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-sdl-first" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-a-rest-api", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-a-rest-api" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrade-from-mongodb-beta", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrade-from-mongodb-beta" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/TablePlus-GUI.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/TablePlus-GUI.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/add-missing-default-constraints-to-columns.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/add-missing-default-constraints-to-columns.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/altering-columns-to-use-enum.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/altering-columns-to-use-enum.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/download-graphql-schema.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/download-graphql-schema.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/expose-prisma-model-fields-with-t-model.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/expose-prisma-model-fields-with-t-model.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/fix-columns-with-json-data-types.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/fix-columns-with-json-data-types.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/fix-incorrect-m-n-relations-sql.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/fix-incorrect-m-n-relations-sql.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/fix-schema-incompatibilities.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/fix-schema-incompatibilities.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/prisma-cli-introspection-flow.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/prisma-cli-introspection-flow.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/regenerate-resolvers-with-t-crud.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/regenerate-resolvers-with-t-crud.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/run-sql-command-to-alter-column.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/run-sql-command-to-alter-column.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/images/use-t-crud-to-generate-resolvers.png", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/images/use-t-crud-to-generate-resolvers.png" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1" - }, - { - "source": "/docs/concepts/more/comparisons/prisma-and-typeorm", - "destination": "/docs/orm/more/comparisons/prisma-and-typeorm" - }, - { - "source": "/docs/concepts/more/comparisons/prisma-and-sequelize", - "destination": "/docs/orm/more/comparisons/prisma-and-sequelize" - }, - { - "source": "/docs/concepts/more/comparisons/prisma-and-mongoose", - "destination": "/docs/orm/more/comparisons/prisma-and-mongoose" - }, - { - "source": "/docs/concepts/more/comparisons/prisma-and-drizzle", - "destination": "/docs/orm/more/comparisons/prisma-and-drizzle" - }, - { - "source": "/docs/concepts/more/comparisons", - "destination": "/docs/orm/more/comparisons" - }, - { - "source": "/docs/guides/migrate-to-prisma/migrate-from-typeorm", - "destination": "/docs/orm/more/migrating-to-prisma/migrate-from-typeorm" - }, - { - "source": "/docs/guides/migrate-to-prisma/migrate-from-sequelize", - "destination": "/docs/orm/more/migrating-to-prisma/migrate-from-sequelize" - }, - { - "source": "/docs/guides/migrate-to-prisma/migrate-from-mongoose", - "destination": "/docs/orm/more/migrating-to-prisma/migrate-from-mongoose" - }, - { - "source": "/docs/guides/migrate-to-prisma", - "destination": "/docs/orm/more/migrating-to-prisma" - }, - { - "source": "/docs/guides/development-environment/environment-variables/env-files", - "destination": "/docs/orm/more/development-environment/environment-variables/env-files" - }, - { - "source": "/docs/guides/development-environment/environment-variables/managing-env-files-and-setting-variables", - "destination": "/docs/orm/more/development-environment/environment-variables/managing-env-files-and-setting-variables" - }, - { - "source": "/docs/guides/development-environment/environment-variables/using-multiple-env-files", - "destination": "/docs/orm/more/development-environment/environment-variables/using-multiple-env-files" - }, - { - "source": "/docs/guides/development-environment/environment-variables", - "destination": "/docs/orm/more/development-environment/environment-variables" - }, - { - "source": "/docs/guides/development-environment/editor-setup", - "destination": "/docs/orm/more/development-environment/editor-setup" - }, - { - "source": "/docs/guides/development-environment", - "destination": "/docs/orm/more/development-environment" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/creating-bug-reports", - "destination": "/docs/orm/more/help-and-troubleshooting/creating-bug-reports" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/autocompletion-in-graphql-resolvers-with-js", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/autocompletion-in-graphql-resolvers-with-js" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/working-with-many-to-many-relations", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/working-with-many-to-many-relations" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-dev-practices" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-monorepo", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-monorepo" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/pkg-issue", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/pkg-issue" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/comparing-columns-through-raw-queries", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/comparing-columns-through-raw-queries" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/vercel-caching-issue", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/vercel-caching-issue" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/netlify-caching-issue", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/netlify-caching-issue" - }, - { - "source": "/docs/guides/other/advanced-database-tasks/data-validation/postgresql", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/check-constraints" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/netlify-build-command-filled.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/netlify-build-command-filled.png" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/netlify-edit-settings.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/netlify-edit-settings.png" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/prisma-autocompletion-in-js.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/prisma-autocompletion-in-js.png" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/unwanted-autocomplete-values-in-vscode.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/unwanted-autocomplete-values-in-vscode.png" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/vercel-ui-build-command-filled.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/vercel-ui-build-command-filled.png" - }, - { - "source": "/docs/guides/other/troubleshooting-orm/help-articles/vercel-ui-build-command.png", - "destination": "/docs/orm/more/help-and-troubleshooting/help-articles/vercel-ui-build-command.png" - }, - { - "source": "/docs/about/prisma/releases", - "destination": "/docs/orm/more/releases" - }, - { - "source": "/docs/data-platform/accelerate/what-is-accelerate", - "destination": "/docs/accelerate/what-is-accelerate" - }, - { - "source": "/docs/data-platform/accelerate/getting-started", - "destination": "/docs/accelerate/getting-started" - }, - { - "source": "/docs/data-platform/accelerate/concepts", - "destination": "/docs/accelerate/concepts" - }, - { - "source": "/docs/data-platform/accelerate/api-reference", - "destination": "/docs/accelerate/api-reference" - }, - { - "source": "/docs/data-platform/accelerate/limitations", - "destination": "/docs/accelerate/limitations" - }, - { - "source": "/docs/data-platform/accelerate/evaluating", - "destination": "/docs/accelerate/evaluating" - }, - { - "source": "/docs/data-platform/accelerate/faq", - "destination": "/docs/accelerate/faq" - }, - { - "source": "/docs/data-platform/accelerate/feedback", - "destination": "/docs/accelerate/feedback" - }, - { - "source": "/docs/data-platform/accelerate/images/accelerate-update-database-connection-string.png", - "destination": "/docs/accelerate/images/accelerate-update-database-connection-string.png" - }, - { - "source": "/docs/data-platform/accelerate/images/accelerate.png", - "destination": "/docs/accelerate/images/accelerate.png" - }, - { - "source": "/docs/data-platform/accelerate/images/no-cache.png", - "destination": "/docs/accelerate/images/no-cache.png" - }, - { - "source": "/docs/data-platform/accelerate/images/speed-test.png", - "destination": "/docs/accelerate/images/speed-test.png" - }, - { - "source": "/docs/data-platform/accelerate/images/swr.png", - "destination": "/docs/accelerate/images/swr.png" - }, - { - "source": "/docs/data-platform/accelerate/images/ttl.png", - "destination": "/docs/accelerate/images/ttl.png" - }, - { - "source": "/docs/data-platform/accelerate/images/ttl_and_swr.png", - "destination": "/docs/accelerate/images/ttl_and_swr.png" - }, - { - "source": "/docs/guides/migrate/developing-with-prisma-migrate", - "destination": "/docs/orm/prisma-migrate" - }, - { - "source": "/docs/guides/migrate/patching-production", - "destination": "/docs/orm/prisma-migrate/workflows/patching-and-hotfixing" - }, - { - "source": "/docs/guides/migrate", - "destination": "/docs/orm/prisma-migrate" - }, - { - "source": "/docs/guides/database", - "destination": "/docs/orm/overview/databases" - }, - { - "source": "/docs/guides/performance-and-optimization/metrics", - "destination": "/docs/orm/prisma-client/observability-and-logging/metrics" - }, - { - "source": "/docs/guides/performance-and-optimization/query-tracing", - "destination": "/docs/orm/prisma-client/observability-and-logging/opentelemetry-tracing" - }, - { - "source": "/docs/guides/performance-and-optimization", - "destination": "/docs/orm/prisma-client/queries/query-optimization-performance" - }, - { - "source": "/docs/guides/upgrade-guides", - "destination": "/docs/orm/more/upgrade-guides" - }, - { - "source": "/docs/guides/other/troubleshooting-orm", - "destination": "/docs/orm/more/help-and-troubleshooting" - }, - { - "source": "/docs/guides/other/advanced-database-tasks/typesafe-raw-sql", - "destination": "/docs/orm/prisma-client/queries/raw-database-access/custom-and-type-safe-queries" - }, - { - "source": "/docs/guides/other/advanced-database-tasks/data-validation", - "destination": "/docs/orm/prisma-client/queries/custom-validation" - }, - { - "source": "/docs/guides/other/advanced-database-tasks", - "destination": "/docs/orm" - }, - { - "source": "/docs/guides/other", - "destination": "/docs/orm" - }, - { - "source": "/docs/guides", - "destination": "/docs/orm" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgresql" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgresql", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-postgresql" - }, - { - "source": "/docs/data-platform/pulse/what-is-pulse", - "destination": "/docs/pulse/what-is-pulse" - }, - { - "source": "/docs/data-platform/pulse/getting-started", - "destination": "/docs/pulse/getting-started" - }, - { - "source": "/docs/data-platform/pulse/concepts", - "destination": "/docs/pulse/concepts" - }, - { - "source": "/docs/data-platform/pulse/api-reference", - "destination": "/docs/pulse/api-reference" - }, - { - "source": "/docs/data-platform/pulse/current-limitations", - "destination": "/docs/pulse/current-limitations" - }, - { - "source": "/docs/data-platform/pulse/faq", - "destination": "/docs/pulse/faq" - }, - { - "source": "/docs/data-platform/pulse/feedback", - "destination": "/docs/pulse/feedback" - }, - { - "source": "/docs/reference/api-reference", - "destination": "/docs/orm/reference" - }, - { - "source": "/docs/reference/database-reference", - "destination": "/docs/orm/reference" - }, - { - "source": "/docs/data-platform/platform-console/about", - "destination": "/docs/platform/platform-console/about" - }, - { - "source": "/docs/data-platform/platform-console/concepts/workspaces", - "destination": "/docs/platform/platform-console/concepts/workspaces" - }, - { - "source": "/docs/data-platform/platform-console/concepts/projects", - "destination": "/docs/platform/platform-console/concepts/projects" - }, - { - "source": "/docs/data-platform/platform-console/concepts", - "destination": "/docs/platform/platform-console/concepts" - }, - { - "source": "/docs/data-platform/platform-console/maturity-levels", - "destination": "/docs/platform/platform-console/maturity-levels" - }, - { - "source": "/docs/data-platform/platform-console/limits", - "destination": "/docs/platform/platform-console/limits" - }, - { - "source": "/docs/data-platform/platform-console/support", - "destination": "/docs/platform/platform-console/support" - }, - { - "source": "/docs/data-platform/platform-console", - "destination": "/docs/platform/platform-console" - }, - { - "source": "/docs/data-platform/classic-projects/data-proxy/use-data-proxy", - "destination": "/docs/platform/classic-projects/data-proxy/use-data-proxy" - }, - { - "source": "/docs/data-platform/classic-projects/data-proxy/deploy", - "destination": "/docs/platform/classic-projects/data-proxy/deploy" - }, - { - "source": "/docs/data-platform/classic-projects/data-proxy/prisma-cli-with-data-proxy", - "destination": "/docs/platform/classic-projects/data-proxy/prisma-cli-with-data-proxy" - }, - { - "source": "/docs/data-platform/classic-projects/data-proxy/considerations-limitations", - "destination": "/docs/platform/classic-projects/data-proxy/considerations-limitations" - }, - { - "source": "/docs/data-platform/classic-projects/data-proxy", - "destination": "/docs/platform/classic-projects/data-proxy" - }, - { - "source": "/docs/data-platform/classic-projects/platform/static-ips", - "destination": "/docs/platform/classic-projects/platform/static-ips" - }, - { - "source": "/docs/data-platform/classic-projects/platform/projects/create", - "destination": "/docs/platform/classic-projects/platform/projects/create" - }, - { - "source": "/docs/data-platform/classic-projects/platform/projects/edit-settings", - "destination": "/docs/platform/classic-projects/platform/projects/edit-settings" - }, - { - "source": "/docs/data-platform/classic-projects/platform/projects/delete-project", - "destination": "/docs/platform/classic-projects/platform/projects/delete-project" - }, - { - "source": "/docs/data-platform/classic-projects/platform/projects", - "destination": "/docs/platform/classic-projects/platform/projects" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/view-all", - "destination": "/docs/platform/classic-projects/platform/environments/view-all" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/create", - "destination": "/docs/platform/classic-projects/platform/environments/create" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/edit-settings/edit-name-and-url-handle", - "destination": "/docs/platform/classic-projects/platform/environments/edit-settings/edit-name-and-url-handle" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/edit-settings/change-default-environment", - "destination": "/docs/platform/classic-projects/platform/environments/edit-settings/change-default-environment" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/edit-settings", - "destination": "/docs/platform/classic-projects/platform/environments/edit-settings" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments/delete", - "destination": "/docs/platform/classic-projects/platform/environments/delete" - }, - { - "source": "/docs/data-platform/classic-projects/platform/environments", - "destination": "/docs/platform/classic-projects/platform/environments" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/roles-permissions", - "destination": "/docs/platform/classic-projects/platform/members/roles-permissions" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/add", - "destination": "/docs/platform/classic-projects/platform/members/add" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/change-role", - "destination": "/docs/platform/classic-projects/platform/members/change-role" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/remove", - "destination": "/docs/platform/classic-projects/platform/members/remove" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/images/team-members-invite-and-select-role.png", - "destination": "/docs/platform/classic-projects/platform/members/images/team-members-invite-and-select-role.png" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members/images/team-members-invite-and-select-role.snagx", - "destination": "/docs/platform/classic-projects/platform/members/images/team-members-invite-and-select-role.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/platform/members", - "destination": "/docs/platform/classic-projects/platform/members" - }, - { - "source": "/docs/data-platform/classic-projects/platform/data-browser", - "destination": "/docs/platform/classic-projects/platform/data-browser" - }, - { - "source": "/docs/data-platform/classic-projects/platform/query-console", - "destination": "/docs/platform/classic-projects/platform/query-console" - }, - { - "source": "/docs/data-platform/classic-projects/platform/schema-viewer", - "destination": "/docs/platform/classic-projects/platform/schema-viewer" - }, - { - "source": "/docs/data-platform/classic-projects/platform/account", - "destination": "/docs/platform/classic-projects/platform/account" - }, - { - "source": "/docs/data-platform/classic-projects/platform/github-integration", - "destination": "/docs/platform/classic-projects/platform/github-integration" - }, - { - "source": "/docs/data-platform/classic-projects/platform/troubleshooting/connection-to-db-timed-out", - "destination": "/docs/platform/classic-projects/platform/troubleshooting/connection-to-db-timed-out" - }, - { - "source": "/docs/data-platform/classic-projects/platform/troubleshooting/cannot-change-db-of-env", - "destination": "/docs/platform/classic-projects/platform/troubleshooting/cannot-change-db-of-env" - }, - { - "source": "/docs/data-platform/classic-projects/platform/troubleshooting/cannot-edit-schema-file", - "destination": "/docs/platform/classic-projects/platform/troubleshooting/cannot-edit-schema-file" - }, - { - "source": "/docs/data-platform/classic-projects/platform/troubleshooting/schema-file-does-not-update", - "destination": "/docs/platform/classic-projects/platform/troubleshooting/schema-file-does-not-update" - }, - { - "source": "/docs/data-platform/classic-projects/platform/troubleshooting", - "destination": "/docs/platform/classic-projects/platform/troubleshooting" - }, - { - "source": "/docs/data-platform/classic-projects/platform", - "destination": "/docs/platform/classic-projects/platform" - }, - { - "source": "/docs/data-platform/classic-projects/support", - "destination": "/docs/platform/classic-projects/support" - }, - { - "source": "/docs/data-platform/classic-projects/images/account/profile-menu-github-account.png", - "destination": "/docs/platform/classic-projects/images/account/profile-menu-github-account.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/account/profile-menu-github-account.snagx", - "destination": "/docs/platform/classic-projects/images/account/profile-menu-github-account.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/account/sign-up-01-create-first-project.png", - "destination": "/docs/platform/classic-projects/images/account/sign-up-01-create-first-project.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/account/sign-up-01-create-first-project.snagx", - "destination": "/docs/platform/classic-projects/images/account/sign-up-01-create-first-project.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/common/open-project-settings.png", - "destination": "/docs/platform/classic-projects/images/common/open-project-settings.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/common/open-project-settings.snagx", - "destination": "/docs/platform/classic-projects/images/common/open-project-settings.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/common/support-pop-up.png", - "destination": "/docs/platform/classic-projects/images/common/support-pop-up.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/common/support-pop-up.snagx", - "destination": "/docs/platform/classic-projects/images/common/support-pop-up.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/models-view.png", - "destination": "/docs/platform/classic-projects/images/data-browser/models-view.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/models-view.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/models-view.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/open-close-models.png", - "destination": "/docs/platform/classic-projects/images/data-browser/open-close-models.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/open-close-models.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/open-close-models.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/model-view-keyboard-shortcuts.png", - "destination": "/docs/platform/classic-projects/images/data-browser/model-view-keyboard-shortcuts.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/model-view-keyboard-shortcuts.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/model-view-keyboard-shortcuts.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/save-multiple-changes.png", - "destination": "/docs/platform/classic-projects/images/data-browser/save-multiple-changes.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/save-multiple-changes.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/save-multiple-changes.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/add-remove-filters.png", - "destination": "/docs/platform/classic-projects/images/data-browser/add-remove-filters.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/add-remove-filters.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/add-remove-filters.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/show-hide-fields.png", - "destination": "/docs/platform/classic-projects/images/data-browser/show-hide-fields.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/show-hide-fields.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/show-hide-fields.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/show-hide-records.png", - "destination": "/docs/platform/classic-projects/images/data-browser/show-hide-records.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/show-hide-records.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/show-hide-records.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/model-sort.png", - "destination": "/docs/platform/classic-projects/images/data-browser/model-sort.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/model-sort.snagx", - "destination": "/docs/platform/classic-projects/images/data-browser/model-sort.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/array.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/array.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/boolean.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/boolean.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/database.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/database.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/datetime.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/datetime.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/enum.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/enum.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/number.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/number.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/object.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/object.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-browser/string.svg", - "destination": "/docs/platform/classic-projects/images/data-browser/string.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/copy-connection-string.png", - "destination": "/docs/platform/classic-projects/images/data-proxy/copy-connection-string.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/copy-connection-string.snagx", - "destination": "/docs/platform/classic-projects/images/data-proxy/copy-connection-string.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/create-and-name-new-connection-string.png", - "destination": "/docs/platform/classic-projects/images/data-proxy/create-and-name-new-connection-string.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/create-and-name-new-connection-string.snagx", - "destination": "/docs/platform/classic-projects/images/data-proxy/create-and-name-new-connection-string.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/prisma-bundle-with-data-proxy.svg", - "destination": "/docs/platform/classic-projects/images/data-proxy/prisma-bundle-with-data-proxy.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/data-proxy/prisma-bundle-without-data-proxy.svg", - "destination": "/docs/platform/classic-projects/images/data-proxy/prisma-bundle-without-data-proxy.svg" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-01-drop-down-select-create.png", - "destination": "/docs/platform/classic-projects/images/environments/create-01-drop-down-select-create.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-01-drop-down-select-create.snagx", - "destination": "/docs/platform/classic-projects/images/environments/create-01-drop-down-select-create.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-env-upload-schema-file.png", - "destination": "/docs/platform/classic-projects/images/environments/create-env-upload-schema-file.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-no-schema-sync-02-repo-branch-database-connection-string-data-proxy.png", - "destination": "/docs/platform/classic-projects/images/environments/create-no-schema-sync-02-repo-branch-database-connection-string-data-proxy.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-no-schema-sync-02-repo-branch-database-connection-string-data-proxy.snagx", - "destination": "/docs/platform/classic-projects/images/environments/create-no-schema-sync-02-repo-branch-database-connection-string-data-proxy.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-on-schema-sync-02-connection-string-static-ips-data-proxy-region.png", - "destination": "/docs/platform/classic-projects/images/environments/create-on-schema-sync-02-connection-string-static-ips-data-proxy-region.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/create-on-schema-sync-02-connection-string-static-ips-data-proxy-region.snagx", - "destination": "/docs/platform/classic-projects/images/environments/create-on-schema-sync-02-connection-string-static-ips-data-proxy-region.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/default-environment.png", - "destination": "/docs/platform/classic-projects/images/environments/default-environment.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/default-environment.snagx", - "destination": "/docs/platform/classic-projects/images/environments/default-environment.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/delete-01-click-three-dot-select-delete.png", - "destination": "/docs/platform/classic-projects/images/environments/delete-01-click-three-dot-select-delete.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/delete-01-click-three-dot-select-delete.snagx", - "destination": "/docs/platform/classic-projects/images/environments/delete-01-click-three-dot-select-delete.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-database-connection-string.png", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-database-connection-string.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-database-connection-string.snagx", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-database-connection-string.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-default.png", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-default.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-default.snagx", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-default.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-name-and-URL-handle.png", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-name-and-URL-handle.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/edit-01-change-name-and-URL-handle.snagx", - "destination": "/docs/platform/classic-projects/images/environments/edit-01-change-name-and-URL-handle.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/list-all-environments.png", - "destination": "/docs/platform/classic-projects/images/environments/list-all-environments.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/list-all-environments.snagx", - "destination": "/docs/platform/classic-projects/images/environments/list-all-environments.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/switch-environment.png", - "destination": "/docs/platform/classic-projects/images/environments/switch-environment.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/switch-environment.snagx", - "destination": "/docs/platform/classic-projects/images/environments/switch-environment.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/view-all-01-environments-drop-down-view-all.png", - "destination": "/docs/platform/classic-projects/images/environments/view-all-01-environments-drop-down-view-all.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/environments/view-all-01-environments-drop-down-view-all.snagx", - "destination": "/docs/platform/classic-projects/images/environments/view-all-01-environments-drop-down-view-all.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/add-github-account-or-org.png", - "destination": "/docs/platform/classic-projects/images/github/add-github-account-or-org.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/add-github-account-or-org.snagx", - "destination": "/docs/platform/classic-projects/images/github/add-github-account-or-org.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/grant-access-github-app.png", - "destination": "/docs/platform/classic-projects/images/github/grant-access-github-app.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/grant-access-github-app.snagx", - "destination": "/docs/platform/classic-projects/images/github/grant-access-github-app.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/grant-access-to-select-github-repositories.png", - "destination": "/docs/platform/classic-projects/images/github/grant-access-to-select-github-repositories.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/github/grant-access-to-select-github-repositories.snagx", - "destination": "/docs/platform/classic-projects/images/github/grant-access-to-select-github-repositories.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/create-02-enable-schema-sync-github-account-branch-schema-path.png", - "destination": "/docs/platform/classic-projects/images/projects/create-02-enable-schema-sync-github-account-branch-schema-path.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/create-02-enable-schema-sync-github-account-branch-schema-path.snagx", - "destination": "/docs/platform/classic-projects/images/projects/create-02-enable-schema-sync-github-account-branch-schema-path.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/create-02-link-schema-file-from-a-repository.png", - "destination": "/docs/platform/classic-projects/images/projects/create-02-link-schema-file-from-a-repository.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/create-02-upload-schema-file.png", - "destination": "/docs/platform/classic-projects/images/projects/create-02-upload-schema-file.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/prisma-data-platform-projects-page.png", - "destination": "/docs/platform/classic-projects/images/projects/prisma-data-platform-projects-page.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/projects/prisma-data-platform-projects-page.snagx", - "destination": "/docs/platform/classic-projects/images/projects/prisma-data-platform-projects-page.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/add-query-with-autocomplete.png", - "destination": "/docs/platform/classic-projects/images/query-console/add-query-with-autocomplete.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/add-query-with-autocomplete.snagx", - "destination": "/docs/platform/classic-projects/images/query-console/add-query-with-autocomplete.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/components.png", - "destination": "/docs/platform/classic-projects/images/query-console/components.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/components.snagx", - "destination": "/docs/platform/classic-projects/images/query-console/components.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/run-query.png", - "destination": "/docs/platform/classic-projects/images/query-console/run-query.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/query-console/run-query.snagx", - "destination": "/docs/platform/classic-projects/images/query-console/run-query.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/overview.png", - "destination": "/docs/platform/classic-projects/images/schema-viewer/overview.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/overview.snagx", - "destination": "/docs/platform/classic-projects/images/schema-viewer/overview.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/project-introspected-schema.png", - "destination": "/docs/platform/classic-projects/images/schema-viewer/project-introspected-schema.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/project-introspected-schema.snagx", - "destination": "/docs/platform/classic-projects/images/schema-viewer/project-introspected-schema.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/project-no-models-no-schema.png", - "destination": "/docs/platform/classic-projects/images/schema-viewer/project-no-models-no-schema.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/project-no-models-no-schema.snagx", - "destination": "/docs/platform/classic-projects/images/schema-viewer/project-no-models-no-schema.snagx" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/project-schema-viewer.png", - "destination": "/docs/platform/classic-projects/images/schema-viewer/project-schema-viewer.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/provide-prisma-schema.png", - "destination": "/docs/platform/classic-projects/images/schema-viewer/provide-prisma-schema.png" - }, - { - "source": "/docs/data-platform/classic-projects/images/schema-viewer/provide-prisma-schema.snagx", - "destination": "/docs/platform/classic-projects/images/schema-viewer/provide-prisma-schema.snagx" - }, - { - "source": "/docs/data-platform/classic-projects", - "destination": "/docs/platform/classic-projects" - }, - { - "source": "/docs/data-platform", - "destination": "/docs/platform" - }, - { - "source": "/docs/about/prisma/example-projects", - "destination": "https://github.com/prisma/prisma-examples/" - }, - { - "source": "/docs/about/prisma/roadmap", - "destination": "/docs/orm/more/releases#roadmap" - }, - { - "source": "/docs/about/prisma/faq", - "destination": "/docs/support" - }, - { - "source": "/docs/about/prisma/limitations", - "destination": "/docs/orm/prisma-schema/data-model/models#limitations" - }, - { - "source": "/docs/about/prisma", - "destination": "/docs/about" - }, - { - "source": "/docs/data-platform/accelerate", - "destination": "/docs/accelerate" - }, - { - "source": "/docs/data-platform/pulse", - "destination": "/docs/pulse" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-mysql", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-mysql" - }, - { - "source": "/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-mysql", - "destination": "/docs/orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-mysql" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/graphql", - "destination": "/docs/orm/overview/prisma-in-your-stack/graphql" - }, - { - "source": "/docs/concepts/overview/prisma-in-your-stack/rest", - "destination": "/docs/orm/overview/prisma-in-your-stack/rest" - }, - { - "source": "/docs/accelerate/concepts", - "destination": "/docs/accelerate" - }, - { - "source": "/docs/platform/classic-projects/data-proxy/:any*", - "destination": "/docs/accelerate" - }, - { - "source": "/docs/platform/classic-projects/platform/:any*", - "destination": "/docs/platform" - }, - { - "source": "/docs/platform/classic-projects/support", - "destination": "https://www.prisma.io/support" - }, - { - "source": "/docs/platform/classic-projects", - "destination": "/docs/platform" - }, - { - "source": "/docs/platform/platform-console/about", - "destination": "/docs/platform/about" - }, - { - "source": "/docs/platform/platform-console/concepts/workspaces", - "destination": "/docs/platform/concepts/workspaces" - }, - { - "source": "/docs/platform/platform-console/concepts/projects", - "destination": "/docs/platform/concepts/projects" - }, - { - "source": "/docs/platform/platform-console/maturity-levels", - "destination": "/docs/platform/maturity-levels" - }, - { - "source": "/docs/platform/platform-console/limits", - "destination": "/docs/platform/limits" - }, - { - "source": "/docs/platform/platform-console/support", - "destination": "/docs/platform/support" - }, - { - "source": "/docs/platform/platform-console", - "destination": "/docs/platform" - }, - { - "source": "/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare-workers", - "destination": "/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare" - }, - { - "source": "/docs/orm/prisma-client/deployment/module-bundlers", - "destination": "/docs/orm/prisma-client/deployment/module-bundlers" - }, - { - "source": "/docs/pulse/current-limitations", - "destination": "/docs/pulse/known-limitations", - "statusCode": 301 - }, - { - "source": "/docs/pulse/current-limitations#change-events-are-not-persisted", - "destination": "/docs/pulse/known-limitations#database-events-are-not-persisted", - "statusCode": 301 - }, - { - "source": "/pulse/current-limitations", - "destination": "/pulse/known-limitations", - "statusCode": 301 - }, - { - "source": "/pulse/getting-started#configuring-replication-slot", - "destination": "/pulse/database-setup/general-database-instructions#enable-logical-replication", - "statusCode": 301 - } - ] -}