Course and Resource now have prie to determine if paid or not

This commit is contained in:
austinkelsay 2024-02-11 20:34:27 -06:00
parent 595c553dd2
commit 6f63062a2e
2 changed files with 4 additions and 2 deletions

View File

@ -38,7 +38,7 @@ CREATE TABLE "Course" (
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"image" TEXT NOT NULL,
"isFree" BOOLEAN NOT NULL DEFAULT false,
"price" INTEGER NOT NULL DEFAULT 0,
"noteId" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
@ -53,6 +53,7 @@ CREATE TABLE "Resource" (
"content" TEXT NOT NULL,
"image" TEXT,
"courseId" INTEGER,
"price" INTEGER NOT NULL DEFAULT 0,
"noteId" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

View File

@ -44,7 +44,7 @@ model Course {
title String
description String
image String
isFree Boolean @default(false)
price Int @default(0)
resources Resource[]
purchases Purchase[]
noteId String? @unique
@ -59,6 +59,7 @@ model Resource {
image String?
course Course? @relation(fields: [courseId], references: [id])
courseId Int?
price Int @default(0)
purchases Purchase[]
noteId String? @unique
createdAt DateTime @default(now())