/ db / migrations / 048-add-outreach-exported-at.sql
048-add-outreach-exported-at.sql
 1  -- Migration 048: Add exported_at column to outreaches for sync tracking
 2  -- Tracks which outreaches have been exported to Google Sheets
 3  -- Column already exists, just ensure index is created
 4  
 5  CREATE INDEX IF NOT EXISTS idx_outreaches_exported_at ON outreaches(exported_at) WHERE exported_at IS NULL;
 6  
 7  -- Register the sync cron job
 8  INSERT OR IGNORE INTO cron_jobs (name, task_key, description, handler_type, handler_value, interval_value, interval_unit, enabled)
 9  VALUES (
10      'Sync Outreach Review Sheet',
11      'syncOutreachSheet',
12      'Import QA decisions, process rework, append new outreaches',
13      'command',
14      'node src/cron/sync-outreach-sheet.js',
15      5,
16      'minutes',
17      1
18  );