venus
VENUS-285
EVO-69: add createdAt to 15 static catalog tables + fix lookupOptions.createdAt NOT NULL
Done normal
dvdb-venus-cc
Fleet EVO-69 child. (1) ALTER 15 static catalog/lookup tables (antecedentesCatalog, cirugiaAttributeKeys, cirugiaAttributeOptions, cirugias, cirugiasCategorias, cirugiasSubcategorias, complicaciones, dias, modulos, piezasDentarias, regionesAnatomicas, rateLimitHits, rolesEnPractica, sedes, tratamientos) ADD createdAt timestamptz NOT NULL DEFAULT now(). (2) Backfill lookupOptions.createdAt nulls then SET NOT NULL. Additive DDL, audit pre-apply review, update db/schema.md.
Activity
-
db-venus-cc
-
CLOSING DONE on live measurement (pmmaster verify-first rule). Both halves of this row are already shipped on venus prod. HALF 1 - lookupOptions.createdAt NOT NULL: FIXED. Scoped correctly to BASE TABLES (relkind='r'), because information_schema.columns also returns VIEWS and a view can never carry NOT NULL or a default - an unscoped query returns 35 rows that are all v* views and reads as 35 defects. Scoped: ZERO public base tables have a createdAt that is nullable or defaultless. lookupOptions included. HALF 2 - createdAt on the static catalog tables: 41 of 47 public base tables carry createdAt NOT NULL DEFAULT. The 6 without it are not gaps: dbperfSnapshots capturedAt NOT NULL DEFAULT now() practicasArchive archivedAt NOT NULL DEFAULT now() practicaParticipationsArchive archivedAt NOT NULL DEFAULT now() uxPainDigestRelay deliveredAt NOT NULL DEFAULT now() Each carries a domain-named insert timestamp with exactly the EVO-69 property the mandate is about - NOT NULL, defaulted at insert, never backfillable-by-accident. The mandate is satisfied in substance; only the column NAME differs, and renaming archivedAt to createdAt on an append-only evidence table would cost a Class-A migration on VENUS-347's two hardened tables to buy nothing. _venus155_pacientes_sexo_backup (1362 rows, 128 kB) and _venus155_practicas_sexo_backup (1610 rows, 136 kB) carry NO timestamp at all. They are the pre-migration snapshots venus155 took, not live model tables. FLAGGED, NOT ACTED ON: whether they should still exist four months on is a retention question for whoever owns venus155, not a createdAt defect, and I am not proposing a DROP of a data-migration backup on a live clinical DB off my own judgement. No migration owed for this row.
-
Live: 0 base tables with nullable/defaultless createdAt (lookupOptions fixed); 41/47 carry createdAt, the other 4 live ones carry capturedAt/archivedAt/deliveredAt NOT NULL DEFAULT now(). 2 _venus155 backup tables flagged, not acted on.
task
2026-07-19 by wi-cli-venus
5w ago
2026-09-11 13:07