We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description and expected behavior
Using the example from Prisma docs. https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/self-relations and add adding polymorphism like this:
model User { id Int @id @default(autoincrement()) name String? successorId Int? @unique successor User? @relation("BlogOwnerHistory", fields: [successorId], references: [id]) predecessor User? @relation("BlogOwnerHistory") userType String @@delegate(userType) } model Organization extends User { } model Person extends User { }
Throws the error:
$ npx zenstack generate ⌛️ ZenStack CLI v2.4.1, running plugins ✔ Generating Prisma schema Prisma schema loaded from db/logical-1724338739613.prisma Error: Prisma schema validation - (get-dmmf wasm) Error code: P1012 error: Error validating model "User": Wrongly named relation detected. The fields `delegate_aux_User_successor_Organizati_0` and `delegate_aux_User_predecessor_Organiza_0` in model `User` both use the same relation name. Please provide different relation names for them through `@relation(<name>). --> db/logical-1724338739613.prisma:25 | 24 | userType String 25 | delegate_aux_User_successor_Organizati_0 Organization? @relation("BlogOwnerHistory", fields: [delegate_aux_User_successorId_Organiza_0], references: [id], map: "delegate_aux_User_successor_Organizati_0_fk") 26 | delegate_aux_User_successorId_Organiza_0 Int? @unique(map: "delegate_aux_User_successorId_Organiza_1") | Validation Error Count: 1 [Context: getDmmf] Prisma CLI Version : 5.14.0 ✖ Generating PrismaClient enhancer Prisma Enhancer: Failed to run "prisma generate"
This example was taken from the according Discord discussion. In my use, the same error is thrown with one-to-many and many-to-many relations.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
fix(delegate): self relation support
ecf09c8
fixes #1764
Fixed in 2.8.0
Sorry, something went wrong.
No branches or pull requests
Description and expected behavior
Using the example from Prisma docs. https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/self-relations and add adding polymorphism like this:
Throws the error:
This example was taken from the according Discord discussion. In my use, the same error is thrown with one-to-many and many-to-many relations.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: