Simon Betton
10/18/2021, 8:34 PMcreatedAt DateTime? @default(now())
Generated TypeScript: createdAt: Date | null
Is this expected? Is this configurable to change? Otherwise I have to pass a value for these optional fields..Pierre Ortega
10/18/2021, 8:49 PMSimon Betton
10/18/2021, 9:00 PMJason Abbott
10/18/2021, 9:15 PMcreatedAt: Date | null
but there should be additional *CreateInput
and *UpdateInput
(etc.) types where you do have createdAt?
, and those are what are used for the actual insert/update/etc.Jason Abbott
10/18/2021, 9:17 PMmodel User {
id Int @id @default(autoincrement())
email String? @unique @db.VarChar(100)
password String? @db.VarChar(100)
}
generates
export type User = {
id: number
email: string | null
password: string | null
}
and (notice id
omitted completely)
export type UserCreateInput = {
email?: string | null
password?: string | null
}
Simon Betton
10/18/2021, 9:19 PM