prisma id required?

why is it not typed as optional?
model ProductCategory {
categoryId String @id @default(uuid())
categoryName String
products Product[] @ignore
}
model ProductCategory {
categoryId String @id @default(uuid())
categoryName String
products Product[] @ignore
}
No description
3 Replies
dan
dan13mo ago
The primary key (@id) cannot be null therefor must have a value
K1|ller
K1|llerOP13mo ago
ok I solved the issue, it is the zod schema type which has the uuid not market as optional i'm generating the zod schemas with a package this solved the issue: createOptionalDefaultValuesTypes = true the problem is that, the schema has a long name looks nasty
K1|ller
K1|llerOP13mo ago
No description
Want results from more Discord servers?
Add your server