-- 013_cluster_registry.sql — v0.6.0
-- PG-backed cluster registry for node self-assembly.
-- UNLOGGED: no WAL overhead, contents lost on PG crash (correct behavior —
-- all nodes are dead anyway and re-register on restart).

CREATE UNLOGGED TABLE IF NOT EXISTS node_registry (
    node_id       TEXT PRIMARY KEY,
    endpoint      TEXT NOT NULL DEFAULT '',
    seq           SERIAL,
    registered_at TIMESTAMPTZ DEFAULT now(),
    heartbeat     TIMESTAMPTZ DEFAULT now(),
    stats         JSONB DEFAULT '{}'
);
