-- 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)';

