Files
panel/controller/internal/db/migrations/005_backups.sql
T
2026-07-14 23:18:05 -07:00

19 lines
772 B
SQL

-- 005_backups.sql — instance backups (tar.gz of volumes).
--
-- The agent writes the archive to disk under its --backup-dir and
-- reports back path + size. Controller persists the row so operators
-- can list / restore / delete later.
CREATE TABLE backups (
id TEXT PRIMARY KEY, -- bkp_<hex16>
instance_id TEXT NOT NULL,
agent_id TEXT NOT NULL,
path TEXT NOT NULL, -- absolute path on the agent
size_bytes BIGINT NOT NULL DEFAULT 0,
description TEXT NOT NULL DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_backups_instance ON backups(instance_id);
CREATE INDEX idx_backups_created ON backups(created_at DESC);