Closed cankush625 closed 5 months ago
As Prisma requested, to disambiguate relations for the same model, you need to add the name argument in the @relation attribute to disambiguate them: https://www.prisma.io/docs/concepts/components/prisma-schema/relations#disambiguating-relations
unfortunately, for now, it's not possible to do so in the abstract model because it can't reference the inherited fields.
We are thinking about two possible ways to resolve it:
model User {
created Base[]
updated Base[]
deleted Base[]
...
}
fixed by #430
Description and expected behavior I have a blog model that extends the AuditModel. Each blog has an author and the audit model has two fields which are created_by and updated_by. All these three fields reference to the User table, which is obvious that all three actors are users. When I try to generate a .prisma file using
npx zenstack generate
command, it gives a validation error that these fields refer to the same relation to model "User".Model's in .zmodel file:
Expected result: Multiple fields should be allowed to refer to the same model
Screenshots
Environment: