diff --git a/prisma/migrations/20221214094628_init/migration.sql b/prisma/migrations/20221214110358_init/migration.sql similarity index 52% rename from prisma/migrations/20221214094628_init/migration.sql rename to prisma/migrations/20221214110358_init/migration.sql index 9f7f21e..eea1424 100644 --- a/prisma/migrations/20221214094628_init/migration.sql +++ b/prisma/migrations/20221214110358_init/migration.sql @@ -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"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index e6c2677..5c56f48 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -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") }