Files
Redflag/aggregator-server/internal/database/migrations/015_agent_subsystems.down.sql
Fimeg 3690472396 feat: granular subsystem commands with parallel scanner execution
Split monolithic scan_updates into individual subsystems (updates/storage/system/docker).
Scanners now run in parallel via goroutines - cuts scan time roughly in half, maybe more.

Agent changes:
- Orchestrator pattern for scanner management
- New scanners: storage (disk metrics), system (cpu/mem/processes)
- New commands: scan_storage, scan_system, scan_docker
- Wrapped existing scanners (APT/DNF/Docker/Windows/Winget) with common interface
- Version bump to 0.1.20

Server changes:
- Migration 015: agent_subsystems table with trigger for auto-init
- Subsystem CRUD: enable/disable, interval (5min-24hr), auto-run toggle
- API routes: /api/v1/agents/:id/subsystems/* (9 endpoints)
- Stats tracking per subsystem

Web UI changes:
- ChatTimeline shows subsystem-specific labels and icons
- AgentScanners got interactive toggles, interval dropdowns, manual trigger buttons
- TypeScript types added for subsystems

Backward compatible with legacy scan_updates - for now. Bugs probably exist somewhere.
2025-11-01 21:34:26 -04:00

18 lines
551 B
SQL

-- Migration: 013_agent_subsystems (down)
-- Purpose: Rollback agent subsystems table
-- Version: 0.1.20
-- Date: 2025-11-01
-- Drop trigger and function
DROP TRIGGER IF EXISTS trigger_create_default_subsystems ON agents;
DROP FUNCTION IF EXISTS create_default_subsystems();
-- Drop indexes
DROP INDEX IF EXISTS idx_agent_subsystems_lookup;
DROP INDEX IF EXISTS idx_agent_subsystems_subsystem;
DROP INDEX IF EXISTS idx_agent_subsystems_next_run;
DROP INDEX IF EXISTS idx_agent_subsystems_agent;
-- Drop table
DROP TABLE IF EXISTS agent_subsystems;