From 6f63062a2e90af1a35ed8e6c8ed29481e0bca431 Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Sun, 11 Feb 2024 20:34:27 -0600 Subject: [PATCH] Course and Resource now have prie to determine if paid or not --- .../{20240211200050_init => 20240212023340_init}/migration.sql | 3 ++- prisma/schema.prisma | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) rename prisma/migrations/{20240211200050_init => 20240212023340_init}/migration.sql (97%) diff --git a/prisma/migrations/20240211200050_init/migration.sql b/prisma/migrations/20240212023340_init/migration.sql similarity index 97% rename from prisma/migrations/20240211200050_init/migration.sql rename to prisma/migrations/20240212023340_init/migration.sql index 65055eb..c29d353 100644 --- a/prisma/migrations/20240211200050_init/migration.sql +++ b/prisma/migrations/20240212023340_init/migration.sql @@ -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, diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ef7fda6..0dc6023 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -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())