From 4ffb72526f7f2f70c3a4509939a444faf7460caa Mon Sep 17 00:00:00 2001 From: ThomasDos Date: Mon, 15 Jul 2024 14:17:41 +0200 Subject: [PATCH] fix(sql): add cascade on delete feasibility --- .../migration.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/reva-api/prisma/migrations/20240711093822_split_feasibility_into_uploaded_pdf_and_dematerialized/migration.sql b/packages/reva-api/prisma/migrations/20240711093822_split_feasibility_into_uploaded_pdf_and_dematerialized/migration.sql index 8705641f3..2196297f9 100644 --- a/packages/reva-api/prisma/migrations/20240711093822_split_feasibility_into_uploaded_pdf_and_dematerialized/migration.sql +++ b/packages/reva-api/prisma/migrations/20240711093822_split_feasibility_into_uploaded_pdf_and_dematerialized/migration.sql @@ -87,10 +87,10 @@ ALTER TABLE "feasibility_uploaded_pdf" ADD CONSTRAINT "feasibility_uploaded_pdf_ ALTER TABLE "feasibility_uploaded_pdf" ADD CONSTRAINT "feasibility_uploaded_pdf_certificate_of_attendance_file_id_fkey" FOREIGN KEY ("certificate_of_attendance_file_id") REFERENCES "file"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "feasibility_uploaded_pdf" ADD CONSTRAINT "feasibility_uploaded_pdf_feasibility_id_fkey" FOREIGN KEY ("feasibility_id") REFERENCES "feasibility"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "feasibility_uploaded_pdf" ADD CONSTRAINT "feasibility_uploaded_pdf_feasibility_id_fkey" FOREIGN KEY ("feasibility_id") REFERENCES "feasibility"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "dematerialized_feasibility_file" ADD CONSTRAINT "dematerialized_feasibility_file_feasibility_id_fkey" FOREIGN KEY ("feasibility_id") REFERENCES "feasibility"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "dematerialized_feasibility_file" ADD CONSTRAINT "dematerialized_feasibility_file_feasibility_id_fkey" FOREIGN KEY ("feasibility_id") REFERENCES "feasibility"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AlterTable ALTER TABLE "feasibility"