Does @updatedAt work in postgres? ```model users ...
# orm-help
k
Does @updatedAt work in postgres?
Copy code
model users {
    id         String    @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
    email      String
    password   String?
    created_at DateTime  @default(now())
    updated_at DateTime  @updatedAt
    deleted_at DateTime?
}
if i create a new user, updated_at is not autofilled generated sql
Copy code
CREATE TABLE "users" (
    "id" UUID NOT NULL DEFAULT gen_random_uuid(),
    "email" TEXT NOT NULL,
    "password" TEXT,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL,
    "deleted_at" TIMESTAMP(3),

    CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);
1
a
Hey there 👋,
@updatedAt
seems to be working fine for me. Are you creating the new user through the Prisma Client or somewhere else?
k
@Austin Youre right i realised i was not using prisma to update the entity, so there was no reason why it would update ( was creating a record via the ui)
👍 1