-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- quickfix for mongodb native type with `@default(auto)` closes prisma/language-tools#1548
- Loading branch information
Showing
5 changed files
with
105 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
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
41 changes: 41 additions & 0 deletions
41
prisma-fmt/tests/code_actions/scenarios/mongodb_auto_native/result.json
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,41 @@ | ||
[ | ||
{ | ||
"title": "Add @db.ObjectId", | ||
"kind": "quickfix", | ||
"diagnostics": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 10, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"character": 0 | ||
} | ||
}, | ||
"severity": 1, | ||
"message": "Error validating field `id` in model `Kattbjorn`: MongoDB `@default(auto())` fields must have `ObjectId` native type." | ||
} | ||
], | ||
"edit": { | ||
"changes": { | ||
"file:///path/to/schema.prisma": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 10, | ||
"character": 46 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"character": 0 | ||
} | ||
}, | ||
"newText": " @db.ObjectId\n" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
prisma-fmt/tests/code_actions/scenarios/mongodb_auto_native/schema.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,12 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "mongodb" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Kattbjorn { | ||
id String @id @default(auto()) @map("_id") | ||
} |
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