Files
MOPC-Portal/prisma/migrations/20260210000000_fix_round_delete_cascades/migration.sql
Matt 882b98be19
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Seed all CSV entries, fix category mapping, add duplicate detection in filtering
- Remove isValidEntry filter from seed: all 214 CSV rows are now seeded
  (Ignore/Doublon/test entries included for AI screening to handle)
- Fix category mapping: normalize non-breaking spaces (U+00A0) that
  caused all categories to map to null
- Add built-in duplicate submission detection in stage-filtering that
  groups projects by submitter email and always flags (never auto-rejects)
  so admin must review
- AI screening runs for duplicates even if deterministic rules fail,
  with sibling project metadata attached for admin context
- Update Candidatures2026.csv with expanded team list
- Simplify routing to award assignment (migration + schema cleanup)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 13:56:18 +01:00

14 lines
781 B
SQL

-- Fix round deletion FK constraint errors
-- Add CASCADE on Evaluation.formId so deleting EvaluationForm cascades to Evaluations
-- Add SET NULL on ProjectFile.roundId so deleting Round nullifies the reference
-- AlterTable: Evaluation.formId -> onDelete CASCADE
ALTER TABLE "Evaluation" DROP CONSTRAINT "Evaluation_formId_fkey";
ALTER TABLE "Evaluation" ADD CONSTRAINT "Evaluation_formId_fkey"
FOREIGN KEY ("formId") REFERENCES "EvaluationForm"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AlterTable: ProjectFile.roundId -> onDelete SET NULL
ALTER TABLE "ProjectFile" DROP CONSTRAINT "ProjectFile_roundId_fkey";
ALTER TABLE "ProjectFile" ADD CONSTRAINT "ProjectFile_roundId_fkey"
FOREIGN KEY ("roundId") REFERENCES "Round"("id") ON DELETE SET NULL ON UPDATE CASCADE;