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

View File

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