Files
bobbanandClaude Sonnet 5.5 7a5b623444 Stale-backup alerts, per-server alert limits, and update runs from the Updates page
- Backups: a guest whose newest backup is older than its limit is an alert (backup kind),
  in the daily backup message, the digest and /metrics (homelab_backup_guests, ..._last_age_seconds)
- Per-server thresholds (servers.thresholds, migration 0030): offline minutes, disk percent,
  forecast window, backup age, and per-disk limits or "leave alone"; applied everywhere the
  global ones were; saving clears the alerts cache
- Update runs (update_runs, migration 0031): Update... on the Updates page puts the server under
  maintenance, runs a Semaphore playbook limited to it, waits for the host to report, and
  reports what is left and whether a restart is due; poller survives restarts
- Notification toggle for update-run results; tests and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:25:09 +02:00

28 lines
986 B
SQL

CREATE TABLE `update_runs` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`server_id` integer NOT NULL,
`integration_id` integer NOT NULL,
`project_id` integer NOT NULL,
`template_id` integer NOT NULL,
`template_name` text NOT NULL,
`host_limit` text NOT NULL,
`task_id` integer,
`task_status` text,
`window_id` integer,
`window_created` integer DEFAULT false NOT NULL,
`status` text NOT NULL,
`message` text,
`started_by` text,
`started_at` text NOT NULL,
`task_ended_at` text,
`host_reported_at` text,
`finished_at` text,
`updates_before` integer,
`updates_after` integer,
`reboot_required` integer DEFAULT false NOT NULL,
`poll_errors` integer DEFAULT 0 NOT NULL,
FOREIGN KEY (`server_id`) REFERENCES `servers`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `update_runs_server_idx` ON `update_runs` (`server_id`,`started_at`);--> statement-breakpoint
CREATE INDEX `update_runs_status_idx` ON `update_runs` (`status`);