Hello here. I am wondering how this works. In the ...
# orm-help
b
Hello here. I am wondering how this works. In the schema I have the following definitions:
Copy code
created_at       DateTime @default(now()) @db.Timestamptz()
last_modified_at DateTime @updatedAt @db.Timestamptz()
My assumption is that both
created_at
and
last_modified_at
will default to
now()
and when I check the
generated types
for
CreateInput
, for both, they look as below:
Copy code
created_at?: Date | string
last_modified_at?: Date | string
But
Prisma Studio
tells me something different: It defaults
last_modified_at
to `now()`'s timestamp as expected and requires me to enter the value for
created_at
! Why isn't it defaulting
created_at
to
now()
?
n
If I understand correctly then when you are trying to insert a record with Prisma Studio
last_modified_at
gets pre-filled but
created_at
doesn’t?
b
Correct!
n
Is this happening on latest
@prisma/client
version?
b
"prisma": "^3.14.0", "@prisma/client": "^3.14.0",
n
Could you create an issue in Prisma Studio Repository for this? https://github.com/prisma/studio/issues/new/choose