Competition/Round architecture: full platform rewrite (Phases 1-9)
Replace Pipeline/Stage system with Competition/Round architecture.
New schema: Competition, Round (7 types), JuryGroup, AssignmentPolicy,
ProjectRoundState, DeliberationSession, ResultLock, SubmissionWindow.
New services: round-engine, round-assignment, deliberation, result-lock,
submission-manager, competition-context, ai-prompt-guard.
Full admin/jury/applicant/mentor UI rewrite. AI prompt hardening with
structured prompts, retry logic, and injection detection. All legacy
pipeline/stage code removed. 4 new migrations + seed aligned.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 23:04:15 +01:00
|
|
|
-- 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;
|