fix(migrations): make v4.3 idempotent and register all missing migrations

- Use DO block to rename xml_unsigned only if it exists
- Register all missing migrations in runner.py including v4.3
This commit is contained in:
2026-06-14 10:05:13 +00:00
parent 0eb5984263
commit 7d21d21200
2 changed files with 17 additions and 1 deletions

View File

@@ -10,7 +10,15 @@
-- ═════════════════════════════════════════════════════════════════════════════
-- 1. CFDI_QUEUE: adapt schema for Facturapi payloads
-- ═════════════════════════════════════════════════════════════════════════════
ALTER TABLE cfdi_queue RENAME COLUMN xml_unsigned TO payload_unsigned;
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'cfdi_queue' AND column_name = 'xml_unsigned'
) THEN
ALTER TABLE cfdi_queue RENAME COLUMN xml_unsigned TO payload_unsigned;
END IF;
END $$;
COMMENT ON COLUMN cfdi_queue.payload_unsigned IS 'Facturapi JSON payload (previously unsigned XML for Horux)';
COMMENT ON COLUMN cfdi_queue.xml_signed IS 'Signed+stamped XML returned by Facturapi';