studio
studio copied to clipboard
Cannot create row with null in Json? field
-
Prisma version (
prisma -vornpx prisma -v):3.11.0 -
Logs from Developer Tools Console or Command line, if any:
Type: undefined
Message:
Invalid `prisma.partner.create()` invocation:
{
data: {
name: 'test',
branding: null,
},
select: {
id: true,
createdAt: true,
updatedAt: true,
name: true,
branding: true,
}
Argument branding for data.branding must not be null. Please use undefined instead.
Code: undefined
Query:
[object Object]
-
Does the issue persist even after updating to the latest
prismaCLI dev version? (npm i -D prisma@dev) Yes! -
Prisma schema (if relevant):
model Partner {
id String @id @default(dbgenerated("cuid()"))
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
name String @map("name")
branding Json? @map("branding")
@@map("partner")
}
Related: https://github.com/prisma/studio/issues/854