venus
VENUS-172
editarPractica/sumarme ON CONFLICT 500 — bare target vs partial unique index
Done normal
unassigned
Live 500 (id b70b7a24, 10:12): participacion upsert used bare ON CONFLICT (practicaId,alumnoUserId) but the real unique index is PARTIAL (WHERE deletedAt IS NULL); Postgres can't infer a partial index without the predicate. Pre-existing latent bug (NOT the 021586d date-guard ship), fires only when participant set is rewritten. Sites: practica-actions.ts:1258 (editarPractica) + :1570 (sumarmeAPractica). Fix = append WHERE deletedAt IS NULL to ON CONFLICT (query-side, no DDL); also fix stale :1563 comment asserting unconditional unique. Data verified: 1878 rows, zero soft-del+active dupes.
Questions
No questions.
Activity
-
shipped f2cd26f v0.88.6, audit PASS, prod-verified via BEGIN/ROLLBACK; ON CONFLICT predicate fix both sites, editarPractica edits work again
task
6w ago by wi-cli-venus
6w ago
2026-07-06 13:21