Files
MOPC-Portal/prisma/migrations/20260211000000_add_file_requirements/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

31 lines
1.1 KiB
SQL

-- CreateTable
CREATE TABLE "FileRequirement" (
"id" TEXT NOT NULL,
"roundId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
"acceptedMimeTypes" TEXT[],
"maxSizeMB" INTEGER,
"isRequired" BOOLEAN NOT NULL DEFAULT true,
"sortOrder" INTEGER NOT NULL DEFAULT 0,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "FileRequirement_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "FileRequirement_roundId_idx" ON "FileRequirement"("roundId");
-- AddForeignKey
ALTER TABLE "FileRequirement" ADD CONSTRAINT "FileRequirement_roundId_fkey" FOREIGN KEY ("roundId") REFERENCES "Round"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AlterTable: add requirementId to ProjectFile
ALTER TABLE "ProjectFile" ADD COLUMN "requirementId" TEXT;
-- CreateIndex
CREATE INDEX "ProjectFile_requirementId_idx" ON "ProjectFile"("requirementId");
-- AddForeignKey
ALTER TABLE "ProjectFile" ADD CONSTRAINT "ProjectFile_requirementId_fkey" FOREIGN KEY ("requirementId") REFERENCES "FileRequirement"("id") ON DELETE SET NULL ON UPDATE CASCADE;