-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fields with @updatedAt are not behaving as expected #728
Comments
Does this behaviour occur when seeding or interacting with the normal prisma client? I've been fixing this issue by setting the model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
} |
oh, this is probably worth trying! |
@chrisdrackett @sam3d That shouldn't be happening 🤔 Without Studio, you shouldn't need to add an explicit In Studio too, this is unexpected. I'll take a look! |
I figured this was a studio but because from what I can tell this works as expected in prisma itself! |
Ah okay, yeah that's a bug in Studio then. Will fix! |
This should be fixed in the latest Do note that |
The variant of this bug still exists on Prisma 3.7.0. When you click "Add Record", the updatedAt column is prepopulated by the time when you clicked that button. As you edit the row and eventually save it, the row gets persisted in the DB but then the |
prisma -v
ornpx prisma -v
): 2.26.0When using prisma studio and adding records with a field that has
@updatedAt
I expect the item to be added with the current dateTime as the value for updated at. Instead it is getting the value1970-01-01T00:00:00.000Z
The text was updated successfully, but these errors were encountered: