add createdAt, updatedAt
This commit is contained in:
parent
95555c476b
commit
c410ad05ee
|
@ -3,11 +3,12 @@ CREATE TABLE "user" (
|
||||||
"uuid" UUID NOT NULL,
|
"uuid" UUID NOT NULL,
|
||||||
"firstName" TEXT NOT NULL,
|
"firstName" TEXT NOT NULL,
|
||||||
"lastName" 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
|
-- CreateIndex
|
||||||
CREATE UNIQUE INDEX "user_email_key" ON "user"("email");
|
CREATE UNIQUE INDEX "user_email_key" ON "user"("email");
|
|
@ -11,10 +11,12 @@ datasource db {
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
uuid String @unique @default(uuid()) @db.Uuid
|
uuid String @id @default(uuid()) @db.Uuid
|
||||||
firstName String
|
firstName String
|
||||||
lastName String
|
lastName String
|
||||||
email String @unique
|
email String @unique
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
@@map("user")
|
@@map("user")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue