Automate Shopify reconciliation in daily cron

This commit is contained in:
gitea_admin committed 2026-09-06 15:31:57 +02:00
1 parent e24394866f
commit bf875f6dea
4 files changed
+85 -3

No files matched your search

@@ -0,0 +1,16 @@
BEGIN;
CREATE TABLE shopify_delta_sync_state (
process_name TEXT PRIMARY KEY,
last_successful_cutoff TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
INSERT INTO shopify_delta_sync_state (process_name, last_successful_cutoff)
SELECT
'erp.import-integration.shopify_delta_order_import',
COALESCE(MAX(shopify_created_at), NOW())
FROM sales_order
WHERE shopify_order_gid IS NOT NULL;
COMMIT;