Mons Erling Mathiesen
06/24/2022, 11:55 AMmodel SomeModel {
id String @id @default(uuid())
name String
SomeRelation SomeRelation? @relation(fields: [someRelationId], references: [id], onDelete: SetNull)
someRelationId String?
Hi, I was wondering if anyone can assist me with the following:
I have a schema (similar to the one above) where the fk to SomeRelation is optional. In my "updateSomeModel" command - I am not allowed to update {someRelationId: null}
even though the field is "nullable". This is problematic due to differentiating between removing an existing value and "not updating" if not set already. Is there a way to update to null on this kind of field?Austin
06/24/2022, 7:18 PMnpx prisma generate
?
Are you getting specific errors you can share?Mons Erling Mathiesen
06/27/2022, 6:39 AMMons Erling Mathiesen
06/27/2022, 7:30 AMForeign key constraint failed on the field: `SomeRelation_someRelationId_fkey (index)`
Mons Erling Mathiesen
07/01/2022, 11:34 AM