Data retention: nightly auto-cleanup (90 days logs, 2 years audit)
Imported from GitHub issue El-SaMa/oma#198 by @El-SaMa.
Agreed 2026-10-14: nothing kept longer than 2 years, logs and notifications 90 days, run nightly (Windmill or OMA cron), so tables don't bloat.
| Data | Keep |
|---|---|
| Staff notifications | 30 days after read, 90 days max |
| Customer notifications | 90 days |
| Error log, mail import log, cron/job logs, Moira/LLM run logs, webhook/event logs | 90 days |
| support_mail_seen (dedupe) | 180 days (needed so old mail isn't re-imported) |
| Audit log | 2 years (max) |
- Inventory every log-like table and its size (start: notifications has about 23,700 staff rows, mostly serverUpdateRunnerFailed and cronJobFailed).
- One retention job with per-table rules + a dry-run count, batched deletes, VACUUM afterwards.
- Staff MCP tool to show and run the retention (dry run by default) + handbook page.
- First run: show the counts before deleting.