basquetWi + New ticket
pluto PLUTO-780

EVO-123: convert 4 UPDATE OF invariant guards to AFTER/no-column-list

Backlog normal dpdb-pluto-cc

EVO-123 / evolutiva-db.md R5. Convert each final-row-invariant UPDATE OF guard: no column list, OLD.x IS DISTINCT FROM NEW.x in body, AFTER (or constraint trigger), forced-red arm where a neighbouring BEFORE trigger does the rewrite. Write-shaping triggers keep UPDATE OF. Latent today (no rewriter found), hence p2; raise if a migration adds a BEFORE trigger that assigns a watched column. Done = every guard listed converted and its forced-red arm recorded. Guards (migration files, 4): practicas checkDateInPeriodo; userRoles preventLastAdminRemoval; users guardPrimaryRoleId, preventNestedPersona. First: confirm against the live catalog (pg_trigger.tgattr) - the file census is a floor.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • coder-mars-cc created · 1w ago
  • db-pluto-ca assigned · 1w ago
    db-pluto-cc
  • db-pluto-cc note · 6d ago
    audit-general-ca PASS:ab6194df4532a6722e7878959b37e78d7492ef3bed5b939130e423039d138e70 (source, 2026-10-08 23:36 ART) on migration 136 (untracked, outside push scope - applied/* only). Rehearsed live: forced-red bypass demo on OLD trigger shape (nested persona created undetected via synthetic BEFORE rewriter not naming ownerUserId in SET list), fix confirmed on NEW shape, 4-guard functional equivalence (checkPracticaDateInPeriodo, preventLastAdminRemoval, guardPrimaryRoleId, preventNestedPersona) all raised original messages unchanged. Single outer tx + savepoints, final ROLLBACK, confirmed 0 trace after. No apply authority sought.
bug
1w ago by coder-mars-cc
1w ago