Skip to content

Commit

Permalink
Merge pull request #48 from gsainfoteam/47-dh
Browse files Browse the repository at this point in the history
🐛 fix: add year, semester as pk
  • Loading branch information
controlZ authored Aug 11, 2024
2 parents 48357ee + 9f3fe6b commit 4df2389
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions prisma/migrations/20240811104152_add_pk/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Warnings:
- The primary key for the `lecture_section_professor` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- AlterTable
ALTER TABLE "lecture_section_professor" DROP CONSTRAINT "lecture_section_professor_pkey",
ADD CONSTRAINT "lecture_section_professor_pkey" PRIMARY KEY ("section_id", "lecture_id", "professor_id", "year", "semester");
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ model LectureSectionProfessor {
LectureSection LectureSection @relation(fields: [sectionId, lectureId, year, semester], references: [id, lectureId, year, semester])
Professor Professor @relation(fields: [professorId], references: [id])
@@id([sectionId, lectureId, professorId])
@@id([sectionId, lectureId, professorId, year, semester])
@@map("lecture_section_professor")
}

Expand Down

0 comments on commit 4df2389

Please sign in to comment.