From f0105f5c2e099e6cabc8a87b410c167b141b6544 Mon Sep 17 00:00:00 2001 From: Rithish-2914 Date: Tue, 1 Dec 2026 12:41:14 +0530 Subject: [PATCH] feat(scripts): remove duplicate paper requests before the unique index #571 adds a unique index on subject + exam + slot + year to PaperRequest, but production already has duplicate requests, so the index can't be built. scripts/dedupe-paper-requests.mjs (npm run dedupe-requests): - dry run by default, lists duplicate groups and what would change - groups by the four fields with surrounding spaces ignored, matching the trimming /api/request does after #571 - --delete keeps the oldest request per group, removes the rest and trims kept rows, after backing them up to paper-request-duplicates-