add createdAt, updatedAt
This commit is contained in:
parent
95555c476b
commit
c410ad05ee
|
@ -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");
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue