Files
Anand fadc1f24e3 Wave 3 (3/3): scheduled fleet health digests + Terraform/Ansible export
- internal/digest: fleet summary builder + scheduler, delivered via the existing notify.Notifier (SMTP/Gotify), admin settings + send-now endpoint
- internal/export: Terraform (proxmox_vm_qemu/proxmox_lxc) and Ansible YAML inventory generators from live fleet inventory, downloadable via /connections/{id}/export/{terraform,ansible}
- Migration renumbered 00031 to avoid colliding with 00026-00030 already on this branch
2026-09-10 15:08:22 +05:30

18 lines
662 B
SQL

-- +goose Up
-- Scheduled fleet health digest (email/webhook summary of uptime, backup
-- success rate, active alerts, capacity) — single-row settings, same
-- pattern as system_settings/notification_settings. last_sent_at drives the
-- scheduler's due-time check (internal/digest.Scheduler); it's NULL until
-- the first send.
CREATE TABLE digest_settings (
id INTEGER PRIMARY KEY CHECK (id = 1),
enabled INTEGER NOT NULL DEFAULT 0,
interval_hours INTEGER NOT NULL DEFAULT 168,
recipients TEXT NOT NULL DEFAULT '',
last_sent_at TEXT,
updated_at TEXT NOT NULL
);
-- +goose Down
DROP TABLE digest_settings;