Skip to content

Commit

Permalink
Add prisma relationMode for PlanetScale
Browse files Browse the repository at this point in the history
  • Loading branch information
SharadKumar committed Jan 8, 2023
1 parent 3246e5a commit 641e8f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

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


Expand Down Expand Up @@ -84,6 +83,7 @@ model Post {
site Site? @relation(fields: [siteId], references: [id], onDelete: Cascade, onUpdate: Cascade)
siteId String?
@@unique([id, siteId], name: "post_site_constraint")
@@index([siteId])
}

model Site {
Expand All @@ -101,6 +101,8 @@ model Site {
user User? @relation(fields: [userId], references: [id])
userId String?
posts Post[]
@@index([userId])
}

model Example {
Expand Down

0 comments on commit 641e8f1

Please sign in to comment.