bassamanator
bassamanator
Explore posts from servers
TtRPC
Created by bassamanator on 5/15/2023 in #❓-help
TRPCClientError when creating a db entry without `updatedAt` value?
Guys, this is my prisma schema:
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Every time I try to create an entry, it fails because I didn't provide a value for updatedAt. How to fix?
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
Thanks! Using t3-app.
7 replies
TTCTheo's Typesafe Cult
Created by bassamanator on 5/15/2023 in #questions
TRCPClientError when creating an entry with blank `updatedAt`
Guys, this is my prisma schema:
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Every time I try to create an entry, it fails because I didn't provide a value for updatedAt. How to fix?
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
Thanks!
4 replies