I just started playing with prisma. In prisma studio I made a new record with the Example table. It is showing updatedAt as having happened before createdAt. Clearly this is incorrect. See screenshot below.
Note createdAt and updatedAt (see screenshot above)
Expected behavior
No response
Prisma information
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
generator client {
provider = "prisma-client-js"
}
model Example {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
import { PrismaClient } from "@prisma/client";
import { env } from "~/env.mjs";
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log:
env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
});
if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
I can confirm it on 5.9.0-dev with the provided schema, but only when using Studio to create the records - prisma.example.create({ data: {} }) on the other hand returns identical timestamps.
Bug description
I just started playing with prisma. In prisma studio I made a new record with the Example table. It is showing updatedAt as having happened before createdAt. Clearly this is incorrect. See screenshot below.
How to reproduce
I'm busy going through the T3 tutorial https://www.youtube.com/watch?v=YkOSUVzOAA4&t=412s
schema.prisma
to value belownpx prisma studio
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version