why am I getting this error when trying to update 1 user and using null in where
await db.user.update({
where: {
id: user.id,
username: null,
},
data: {
username: result.data.username,
},
}); await db.user.update({
where: {
id: user.id,
username: null,
},
data: {
username: result.data.username,
},
});this is my schema
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions", "strictUndefinedChecks"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [citext(schema: "pg_catalog")]
}
model User {
id String @id @default(cuid())
username String? @unique @db.Citext
githubId String? @unique
email String @db.VarChar(200)
avatarUrl String?
// avatarSource
Post Post[]
@@map("users")
}
model Post {
id String @id @default(cuid())
title String @db.VarChar(20)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("posts")
}// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions", "strictUndefinedChecks"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [citext(schema: "pg_catalog")]
}
model User {
id String @id @default(cuid())
username String? @unique @db.Citext
githubId String? @unique
email String @db.VarChar(200)
avatarUrl String?
// avatarSource
Post Post[]
@@map("users")
}
model Post {
id String @id @default(cuid())
title String @db.VarChar(20)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("posts")
}