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:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user