Skip to content

Commit

Permalink
chore: add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sjschlapbach committed Oct 1, 2024
1 parent 04082f7 commit 33d143c
Showing 1 changed file with 20 additions and 0 deletions.
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;

0 comments on commit 33d143c

Please sign in to comment.