fix: handle NULL reboot_reason values from database

The reboot_reason field was defined as string instead of *string, causing
database scan failures when the column contains NULL values. This broke
agent list loading on existing installations after migration.

- Changed reboot_reason to *string in both Agent and AgentWithLastScan structs
- Added DEFAULT empty string to migration for new installations
- Added README section for full server reinstall procedure
This commit is contained in:
Fimeg
2025-10-31 17:34:05 -04:00
parent e72e9fc16f
commit 5e9c27b7ef
3 changed files with 40 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
ALTER TABLE agents
ADD COLUMN reboot_required BOOLEAN DEFAULT FALSE,
ADD COLUMN last_reboot_at TIMESTAMP,
ADD COLUMN reboot_reason TEXT;
ADD COLUMN reboot_reason TEXT DEFAULT '';
-- Add index for efficient querying of agents needing reboot
CREATE INDEX idx_agents_reboot_required ON agents(reboot_required) WHERE reboot_required = TRUE;