From 230296c13700bf076d5297a76587b37985944e67 Mon Sep 17 00:00:00 2001 From: lorentz Date: Sat, 11 Jul 2026 09:46:01 -0400 Subject: [PATCH] feat(13-01): seed pax8-daily sync schedule via migration 096 - Idempotent INSERT ... WHERE NOT EXISTS seed of the pax8-daily row (cron 0 4 * * *, is_enabled false), mirroring migration 089's style - Covers existing installs since createDefaultSchedules() only seeds a virgin sync_schedules table - Applied to running dev DB and verified idempotent (second run = 0 rows) --- migrations/096_pax8_daily_schedule.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrations/096_pax8_daily_schedule.sql diff --git a/migrations/096_pax8_daily_schedule.sql b/migrations/096_pax8_daily_schedule.sql new file mode 100644 index 0000000..b5f2dd5 --- /dev/null +++ b/migrations/096_pax8_daily_schedule.sql @@ -0,0 +1,13 @@ +-- Migration 096: Seed the pax8-daily sync schedule. +-- +-- The sync_scheduler.createDefaultSchedules() path only seeds defaults on a +-- virgin sync_schedules table; this migration covers existing installs. +-- sync_schedules has no unique constraint on name, so guard with NOT EXISTS +-- (same pattern as migration 089's appgate-sessions/appgate-daily seeds). + +INSERT INTO sync_schedules (id, name, description, cron_expression, sync_type, is_enabled) +SELECT 'pax8-daily', + 'PAX8 Daily Sync', + 'Full PAX8 sync — companies, subscriptions, products, orders, and company matching, daily at 4 AM.', + '0 4 * * *', 'pax8-daily', false + WHERE NOT EXISTS (SELECT 1 FROM sync_schedules WHERE name = 'PAX8 Daily Sync');