Nditah Samweld
06/19/2022, 3:02 PMunique
input field phone
NULL
instead of "`undefined`" for missing input.
PostgreSQL guarantees uniqueness even for NULL
fields but not for undefined
values.
model User {
id String @id @default(cuid())
email String @unique
phone String? @unique
@@map(name: "user")
}
Harsh Singh
06/20/2022, 7:20 AM?
if you need to make anything optional, but I see you've already added that. For making something null instead of undefined, just pass in phone number as null when you're creating it.Nurul
06/20/2022, 10:09 AMNditah Samweld
06/28/2022, 3:58 PM