-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04082f7
commit 33d143c
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/prisma/src/prisma/migrations/20241001202725_course_cascade_deletion/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
Warnings: | ||
- Made the column `courseId` on table `ParticipantGroup` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "LeaderboardEntry" DROP CONSTRAINT "LeaderboardEntry_courseId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "ParticipantGroup" DROP CONSTRAINT "ParticipantGroup_courseId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "ParticipantGroup" ALTER COLUMN "courseId" SET NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ParticipantGroup" ADD CONSTRAINT "ParticipantGroup_courseId_fkey" FOREIGN KEY ("courseId") REFERENCES "Course"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "LeaderboardEntry" ADD CONSTRAINT "LeaderboardEntry_courseId_fkey" FOREIGN KEY ("courseId") REFERENCES "Course"("id") ON DELETE CASCADE ON UPDATE CASCADE; |