-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2864 from tsedio/fix-prisma-circular-esm-ref
fix(prisma): fix circular reference when column is optional
- Loading branch information
Showing
15 changed files
with
106 additions
and
165 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
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
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,10 @@ | ||
{ | ||
"name": "@tsed/prisma-test", | ||
"type": "commonjs", | ||
"devDependencies": { | ||
"prisma": "^4.0.0" | ||
}, | ||
"dependencies": { | ||
"@prisma/client": "^4.0.0" | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/orm/prisma/test/circular-ref/prisma/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,32 @@ | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
binaryTargets = ["native", "windows", "debian-openssl-1.1.x"] | ||
output = "../prisma/generated/client" | ||
} | ||
|
||
generator tsed { | ||
provider = "node ../../lib/cjs/generator.js" | ||
output = "../prisma/generated/tsed" | ||
emitDMMF = true | ||
} | ||
|
||
model Conversation { | ||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid | ||
assignmentId String? @map("assignment_id") @db.Uuid | ||
assignment Assignment? @relation(fields: [assignmentId], references: [id], onDelete: NoAction, onUpdate: NoAction) | ||
@@map("conversation") | ||
} | ||
|
||
model Assignment { | ||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid | ||
conversations Conversation[] | ||
@@map("assignment") | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/orm/prisma/test/snapshots/generate_code/enums/index.ts
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 |
---|---|---|
@@ -1 +1 @@ | ||
export {Role} from "./Role"; | ||
export { Role } from "./Role"; |
2 changes: 1 addition & 1 deletion
2
packages/orm/prisma/test/snapshots/generate_code/interfaces/index.ts
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
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
4 changes: 2 additions & 2 deletions
4
packages/orm/prisma/test/snapshots/generate_code/models/index.ts
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export {PostModel} from "./PostModel"; | ||
export {UserModel} from "./UserModel"; | ||
export { PostModel } from "./PostModel"; | ||
export { UserModel } from "./UserModel"; |
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
Oops, something went wrong.