fix(db): Add missing Swapper metrics columns to node_cache

This commit is contained in:
Apple
2025-12-02 06:54:37 -08:00
parent ace183e136
commit 92d8efa5b3

View File

@@ -0,0 +1,14 @@
-- Migration: Add Swapper metrics columns to node_cache
-- Purpose: Store Swapper Service metrics collected by node-guardian
ALTER TABLE node_cache
ADD COLUMN IF NOT EXISTS swapper_healthy boolean DEFAULT false,
ADD COLUMN IF NOT EXISTS swapper_models_loaded integer DEFAULT 0,
ADD COLUMN IF NOT EXISTS swapper_models_total integer DEFAULT 0,
ADD COLUMN IF NOT EXISTS swapper_state jsonb;
COMMENT ON COLUMN node_cache.swapper_healthy IS 'Whether Swapper Service is healthy on this node';
COMMENT ON COLUMN node_cache.swapper_models_loaded IS 'Number of models currently loaded in VRAM';
COMMENT ON COLUMN node_cache.swapper_models_total IS 'Total number of available models';
COMMENT ON COLUMN node_cache.swapper_state IS 'Full Swapper state including models list (JSONB)';