layhodib
layhodib
PPrisma
Created by layhodib on 2/9/2025 in #help-and-questions
Nullable Datetime Field
hello i'm trying to create a field last_purchase_date but there's a case where user has not purchased yet so i want the field to be null. this is what i have in schema.prisma
model Item {
last_purchase_date DateTime?
}
model Item {
last_purchase_date DateTime?
}
and this seems to work, the field can be null, but when i try to query it with prisma i get this error.
Error converting field "last_purchase_date" of expected non-nullable type "DateTime", found incompatible value of "null"
Error converting field "last_purchase_date" of expected non-nullable type "DateTime", found incompatible value of "null"
4 replies