Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update referentialIntegrity to relationMode for Prisma 4.7.0 #223

Merged
merged 5 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/tutorials/automatic-prisma-migrations.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Automatic Prisma migrations'
subtitle: 'How to make changes to your PlanetScale database schema while using Prisma, a next-generation Node.js and TypeScript ORM'
date: '2022-08-01'
date: '2022-11-29'
---

import InfoBlock from '@/components/MDX.InfoBlock'
Expand Down Expand Up @@ -63,16 +63,19 @@ pscale connect prisma-playground main --port 3309

3. Update your `prisma/schema.prisma` file with the following schema:

```
<InfoBlock type='note'>
In Prisma `4.5.0`, `referentialIntegrity` changed to `relationMode` and became generally available in `4.7.0`. The following schema reflects this change.
</InfoBlock>

```js
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
relationMode = "prisma"
}

generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}

model Post {
Expand Down
9 changes: 6 additions & 3 deletions docs/tutorials/prisma-data-platform-integration.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'PlanetScale and Prisma Data Platform integration'
subtitle: 'Use the Prisma Data Platform to auto-generate a project with Prisma and PlanetScale and deploy it to Vercel.'
date: '2022-09-28'
date: '2022-11-29'
---

import ImageBlock from '@/components/MDX.ImageBlock'
Expand Down Expand Up @@ -58,16 +58,19 @@ Next, you need to connect your Prisma project to your PlanetScale database. Here
If you are using an existing Prisma project, you can skip updating the schema in steps 9 and 10.
</InfoBlock>

<InfoBlock type='note'>
In Prisma `4.5.0`, `referentialIntegrity` changed to `relationMode` and became generally available in `4.7.0`. The following schema reflects this change.
</InfoBlock>

```js
generator client {
provider = "prisma-client-js" //If you want to use TypeScript, use "prisma-client-ts"
previewFeatures = ["referentialIntegrity"]
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
relationMode = "prisma"
}
```

Expand Down
10 changes: 7 additions & 3 deletions docs/tutorials/prisma-quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
title: 'Prisma with PlanetScale quickstart'
subtitle: 'Learn how to integrate Prisma with PlanetScale'
date: '2022-07-22'
date: '2022-11-29'
---

import ImageBlock from '@/components/MDX.ImageBlock'
import schema from '@/images/prisma-quickstart--schema.png'
import studio from '@/images/prisma-quickstart--studio.png'
import InfoBlock from '@/components/MDX.InfoBlock'

## Overview

Expand Down Expand Up @@ -97,18 +98,21 @@ npx prisma init

This creates the `prisma` directory with a file named `schema.prisma`. This file will hold your [Prisma schema configuration](https://www.prisma.io/docs/concepts/components/prisma-schema), which includes your data sources (PlanetScale), generators ([Prisma Client](https://www.prisma.io/docs/concepts/components/prisma-client)), and data models.

<InfoBlock type='note'>
In Prisma `4.5.0`, `referentialIntegrity` changed to `relationMode` and became generally available in `4.7.0`. The following schema reflects this change.
</InfoBlock>

Open up the `prisma/schema.prisma` file and paste in the following:

```js
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
relationMode = "prisma"
}

generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}

model Star {
Expand Down