From f056ccb03ff61e51147a3a50f349185ccfc55413 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 17 Apr 2025 20:47:26 +1000 Subject: [PATCH] Add courseId field to class in database --- .../migration.sql | 2 ++ server/prisma/migrations/migration_lock.toml | 2 +- server/prisma/schema.prisma | 11 ++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 server/prisma/migrations/20250414034722_add_courseid_to_class/migration.sql diff --git a/server/prisma/migrations/20250414034722_add_courseid_to_class/migration.sql b/server/prisma/migrations/20250414034722_add_courseid_to_class/migration.sql new file mode 100644 index 000000000..a7e60c24e --- /dev/null +++ b/server/prisma/migrations/20250414034722_add_courseid_to_class/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "classes" ADD COLUMN "courseId" TEXT; diff --git a/server/prisma/migrations/migration_lock.toml b/server/prisma/migrations/migration_lock.toml index 648c57fd5..044d57cdb 100644 --- a/server/prisma/migrations/migration_lock.toml +++ b/server/prisma/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually # It should be added in your version-control system (e.g., Git) -provider = "postgresql" \ No newline at end of file +provider = "postgresql" diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index 11a2d6441..7ab237d2f 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -50,14 +50,14 @@ model Event { // Event Time // TODO: revert this change after custom event dates are added - day Int - start Int - end Int - subtype String + day Int + start Int + end Int + subtype String // day String // start DateTime // end DateTime - + timetable Timetable? @relation(fields: [timetableId], references: [id], onDelete: Cascade) // TODO: was there a reason this wasn't cascaded on delete? timetableId String? groupIds String[] // Added to link an event to a group @@ -71,6 +71,7 @@ model Class { term String year String courseCode String + courseId String? Timetable Timetable? @relation(fields: [timetableId], references: [id], onDelete: Cascade) timetableId String? activity String