-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ensure the emulated referential action 'NoAction' is not valid …
…for postgres and sqlite
- Loading branch information
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...tests__/fixtures/referential-actions/no-action/relationMode-prisma/prisma/postgres.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["referentialIntegrity"] | ||
} | ||
|
||
datasource db { | ||
provider = "postgres" | ||
url = env("TEST_POSTGRES_URI") | ||
relationMode = "prisma" | ||
} | ||
|
||
model SomeUser { | ||
id String @id @default(cuid()) | ||
profileUpdate ProfileUpdateNoAction? | ||
profileDelete ProfileDeleteNoAction? | ||
enabled Boolean? | ||
} | ||
|
||
model ProfileUpdateNoAction { | ||
id String @id @default(cuid()) | ||
user SomeUser @relation(fields: [userId], references: [id], onUpdate: NoAction) | ||
userId String @unique | ||
enabled Boolean? | ||
} | ||
|
||
model ProfileDeleteNoAction { | ||
id String @id @default(cuid()) | ||
user SomeUser @relation(fields: [userId], references: [id], onDelete: NoAction) | ||
userId String @unique | ||
enabled Boolean? | ||
} |
23 changes: 23 additions & 0 deletions
23
...__tests__/fixtures/referential-actions/no-action/relationMode-prisma/prisma/sqlite.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["referentialIntegrity"] | ||
} | ||
|
||
datasource db { | ||
provider = "sqlite" | ||
url = "file:./db.dev" | ||
relationMode = "prisma" | ||
} | ||
|
||
model SomeUser { | ||
id String @id @default(cuid()) | ||
profileNoAction ProfileNoAction? | ||
enabled Boolean? | ||
} | ||
|
||
model ProfileNoAction { | ||
id String @id @default(cuid()) | ||
user SomeUser @relation(fields: [userId], references: [id], onUpdate: NoAction, onDelete: NoAction) | ||
userId String @unique | ||
enabled Boolean? | ||
} |