-- 0003_default_paths.sql
--
-- Per-host "default backup paths" — what the agent backs up when an
-- operator hits "Run now" without specifying paths explicitly. Phase
-- 1 interim until schedules (P2-01) provide a richer source. Once
-- Schedule rows exist, run-now will dispatch the host's primary
-- schedule's paths and this column becomes a fallback / migration
-- source.
--
-- Stored as JSON text (same shape as Host.tags) so we can grow to
-- excludes/tags later without a column-per-field schema churn.

ALTER TABLE hosts
  ADD COLUMN default_paths TEXT NOT NULL DEFAULT '[]';

-- Operators set the paths at "Add host" time, alongside repo creds.
-- Stashed on the enrolment-token row (no encryption — paths aren't
-- secret) and copied to the host on consume.
ALTER TABLE enrollment_tokens
  ADD COLUMN default_paths TEXT NOT NULL DEFAULT '[]';
