basquetWi + New ticket

Carga transaccional

Done normal dmdb-mba-l-cc

Un solo script psql, ON_ERROR_STOP. BEGIN; TRUNCATE las 5 tablas de vehiculos RESTART IDENTITY; cargar dumps de staging en orden de FK (vehiculos -> vdc -> historial); filtrar historial a una fila vigente por vehiculo; dejar los archives vacios; limpiar app_logs + audit_log; bloques DO de verificacion; COMMIT. NO deshabilitar triggers, NO usar pg_restore --disable-triggers - mantener FK activas. TRUNCATE no dispara nada; COPY dispara solo el idempotente trg_vehiculos_dominio_norm; los triggers de archive son UPDATE/DELETE. NO piped pg_dump de staging directo a dev - conservar artefactos inmutables con checksum.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 1w ago
    parent=#2499
  • wi-cli-venus commented · 1w ago
    db03-mba-l-ca 2026-08-07: el filtro de origen es EXPLICITO, nunca 'el ultimo'. vehiculos: borrado_en IS NULL. VDC: join a esos vehiculos con d.borrado_en IS NULL AND d.fecha_vigencia_hasta IS NULL. historial: join a esos vehiculos con h.borrado_en IS NULL. Preservar IDs de staging y columnas explicitas. TRUNCATE de todas las tablas afectadas juntas. NUNCA max(id)/heuristica de 'latest' - filtrar la fila equivocada es el unico riesgo de integridad real. Si se aprueba active-only, los totales fisicos esperados post-carga son 1.600/1.600/1.600, no los totales completos de staging.
  • wi-cli-venus commented · 1w ago
    2026-08-07 debt remap outcome for active-only source: 206 dev deudas rows total; only 6 normalized dominios exist in the 1,600 staging active fleet; 200 would remain with vehiculo_id NULL after preservation/remap. Treat this as detachment, not preservation, and output the full unmatched list. Existing duplicate UNIQUE constraints on deudas.vehiculo_id require a one-to-one normalized-domain precheck. Full-fleet scope would need a fresh measurement.
  • wi-cli-venus assigned · 1w ago
    db-mba-l-cc / db
  • wi-cli-venus commented · 1w ago
    Script ready: agents/db-mba-l/sync-staging-to-dev-20260807.sh (export/backup/dry-run/run). Dry-run green. Awaiting Elazar GO to run.
  • wi-cli-venus completed · 1w ago
    Committed on Elazar GO 2026-08-07 ~15:5x. 1566 upd (change-guarded) / 34 ins / 22 soft-del; rsm id=3 -> PP; rendiciones 206 intact.
task
1w ago by wi-cli-venus
1w ago
2026-08-07 18:53