Closed jasonmacdonald closed 1 year ago
Hi @jasonmacdonald , thanks for reporting this, and I think I know why it's broken. The ZModel compiler hoists all enum fields to the global scope - apparently not the right thing to do ... but it shouldn't be hard to fix.
For now I think you can circumvent this issue using the @prisma.passthrough
attribute to force passing the @default
part to Prisma, like:
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
first SecondEnum @prisma.passthrough('@default(E1)') // <- here
second FirstEnum @default(E1)
posts Post[]
}
Fixed by #513
Description and expected behavior I'm unsure if this is just a visual-studio plugin bug or if it goes deeper (EDIT: I can confirm this blocks generation), but It seems you cannot use two enums in your schema, which both use the same name as one of its values. Whenever you try to reference the value of the second
ENUM
the error appearsValue is not assignable to parameter zmodel.
Note that I get no such error in Prisma itself.
Simplified Reproduction
Environment (please complete the following information):