add createdAt, updatedAt

This commit is contained in:
Gsk54 2022-12-14 12:10:27 +01:00
parent 95555c476b
commit c410ad05ee
2 changed files with 9 additions and 6 deletions

View File

@ -3,11 +3,12 @@ CREATE TABLE "user" (
"uuid" UUID NOT NULL,
"firstName" TEXT NOT NULL,
"lastName" TEXT NOT NULL,
"email" TEXT NOT NULL
"email" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "user_pkey" PRIMARY KEY ("uuid")
);
-- CreateIndex
CREATE UNIQUE INDEX "user_uuid_key" ON "user"("uuid");
-- CreateIndex
CREATE UNIQUE INDEX "user_email_key" ON "user"("email");

View File

@ -11,10 +11,12 @@ datasource db {
}
model User {
uuid String @unique @default(uuid()) @db.Uuid
uuid String @id @default(uuid()) @db.Uuid
firstName String
lastName String
email String @unique
email String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("user")
}