Files
hyungi_document_server/migrations/003_automation_state.sql
Hyungi Ahn 31d5498f8d feat: implement Phase 3 automation workers
- Add automation_state table for incremental sync (last UID, last check)
- Add law_monitor worker: 국가법령정보센터 API → NAS/DB/CalDAV VTODO
  (LAW_OC 승인 대기 중, 코드 완성)
- Add mailplus_archive worker: IMAP(993) → .eml NAS save + DB + SMTP
  notification (imaplib via asyncio.to_thread, timeout=30)
- Add daily_digest worker: PostgreSQL/pipeline stats → Markdown + SMTP
  (documents, law changes, email, queue errors, inbox backlog)
- Add CalDAV VTODO helper and SMTP email helper to core/utils.py
- Wire 3 cron jobs in APScheduler (law@07:00, mail@07:00+18:00,
  digest@20:00) with timezone=Asia/Seoul

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:24:50 +09:00

9 lines
273 B
SQL

-- 자동화 워커 상태 저장 (증분 동기화용)
CREATE TABLE automation_state (
id BIGSERIAL PRIMARY KEY,
job_name VARCHAR(50) NOT NULL UNIQUE,
last_check_value TEXT,
last_run_at TIMESTAMPTZ,
updated_at TIMESTAMPTZ DEFAULT NOW()
);