feat(prisma): add Traning model
This commit is contained in:
parent
d765851f29
commit
a8b7a0c118
2 changed files with 40 additions and 0 deletions
23
prisma/migrations/20230625133945_/migration.sql
Normal file
23
prisma/migrations/20230625133945_/migration.sql
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
-- CreateTable
|
||||
CREATE TABLE "Training" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"slug" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"days" INTEGER NOT NULL,
|
||||
"weight" INTEGER NOT NULL,
|
||||
"draft" BOOLEAN NOT NULL DEFAULT true,
|
||||
"logoURL" TEXT,
|
||||
"repositoryURL" TEXT,
|
||||
"priceOpen" INTEGER NOT NULL,
|
||||
"priceCorporate" INTEGER NOT NULL,
|
||||
"content" TEXT,
|
||||
|
||||
CONSTRAINT "Training_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Training_slug_key" ON "Training"("slug");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Training_slug_idx" ON "Training"("slug");
|
||||
|
|
@ -15,6 +15,23 @@ datasource db {
|
|||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model Training {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
slug String @unique
|
||||
description String?
|
||||
days Int
|
||||
weight Int
|
||||
draft Boolean @default(true)
|
||||
logoURL String?
|
||||
repositoryURL String?
|
||||
priceOpen Int
|
||||
priceCorporate Int
|
||||
content String?
|
||||
|
||||
@@index([slug])
|
||||
}
|
||||
|
||||
// Necessary for Next auth
|
||||
model Account {
|
||||
id String @id @default(cuid())
|
||||
|
|
|
|||
Reference in a new issue