-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
Milestone
Description
Description and expected behavior
I am trying to use polymorphic models. I have a base model and a model which extends the base model. I want to create a unique constraint on the extended model which includes a combination of the base model and the extend model. It fails with an error telling me that the field is not found on the extended model.
Environment (please complete the following information):
- ZenStack version: ^2.6.2
- Prisma version: ^5.20.0
- Database type: Postgresql
Additional context
Error: Error validating model "Store": The unique index definition refers to the unknown fields: organizationId.
model Content {
contentType String
organization Organization @relation("OrganizationContents", fields: [organizationId], references: [id])
organizationId String @db.Uuid
@@delegate(contentType)
}
model Store extends Content {
name String
@@unique([organizationId, name])
}
