Skip to content

Commit 037f1fa

Browse files
committed
Add test case for completions when relationMode = prisma
1 parent a5665d0 commit 037f1fa

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"isIncomplete": false,
3+
"items": [
4+
{
5+
"label": "Cascade",
6+
"kind": 13,
7+
"detail": "Delete the child records when the parent record is deleted."
8+
},
9+
{
10+
"label": "Restrict",
11+
"kind": 13,
12+
"detail": "Prevent deleting a parent record as long as it is referenced."
13+
},
14+
{
15+
"label": "NoAction",
16+
"kind": 13,
17+
"detail": "Prevent deleting a parent record as long as it is referenced."
18+
},
19+
{
20+
"label": "SetNull",
21+
"kind": 13,
22+
"detail": "Set the referencing fields to NULL when the referenced record is deleted."
23+
}
24+
]
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
datasource db {
2+
provider = "mongodb"
3+
url = env("DATABASE_URL")
4+
}
5+
6+
model Post {
7+
id String @id @default(auto()) @map("_id") @db.ObjectId
8+
title String
9+
author User @relation(fields: [authorId], references: [id], onDelete: <|>)
10+
authorId String @db.ObjectId
11+
}
12+
13+
model User {
14+
id String @id @default(auto()) @map("_id") @db.ObjectId
15+
posts Post[]
16+
}

prisma-fmt/tests/text_document_completion/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ scenarios! {
3535
referential_actions_in_progress_2
3636
referential_actions_middle_of_args_list
3737
referential_actions_mssql
38+
referential_actions_relation_mode_prisma
3839
referential_actions_with_trailing_comma
3940
datasource_default_completions
4041
datasource_multischema

0 commit comments

Comments
 (0)