-- 0004_repo_initialised.sql
--
-- Track whether a host's restic repo has been initialised. Set when:
--   1. a `repo_init` job succeeds, OR
--   2. any backup job succeeds (proves the repo exists), OR
--   3. a snapshots.report arrives with at least one snapshot.
--
-- Once set, never cleared by code — only by the operator deleting the
-- host or wiping the column manually if they re-pointed the agent at
-- a different (empty) repo. The UI keys off NULL/non-NULL to decide
-- whether to surface the red "Initialise repo" affordance in the
-- run-now panel.

ALTER TABLE hosts
  ADD COLUMN repo_initialised_at TEXT;
