Consider this schema:
model Comment {
id Int @id @default(autoincrement())
reply Comment? @relation(fields: [replyId], references: [id], onDelete: SetNull)
replyId Int? @default(null)
comment String
}
Here both reply
and replyId
are nullable. When I migrate I get this error:
error: Error parsing attribute "@default": Expected a numeric value, but received literal value "Null".
--> schema.prisma:70
|
69 | reply Comment? @relation(fields: [replyId], references: [id], onDelete: SetNull)
70 | replyId Int? @default(null)
|
Why?