BugFix
All checks were successful
release-tag / release-image (push) Successful in 2m11s

This commit is contained in:
2026-04-24 20:35:23 +02:00
parent 90eeb98882
commit cdee259fb1
2 changed files with 38 additions and 5 deletions

View File

@@ -1290,4 +1290,26 @@ VALUES
0,
86400,
0
);
);
UPDATE detection_rules
SET description = ''
WHERE description IS NULL;
UPDATE detection_rules
SET match_field = ''
WHERE match_field IS NULL;
UPDATE detection_rules
SET match_operator = ''
WHERE match_operator IS NULL;
UPDATE detection_rules
SET match_value = ''
WHERE match_value IS NULL;
ALTER TABLE detection_rules
MODIFY description TEXT NULL,
MODIFY match_value TEXT NULL,
MODIFY match_field VARCHAR(64) NOT NULL DEFAULT '',
MODIFY match_operator VARCHAR(16) NOT NULL DEFAULT '';

19
main.go
View File

@@ -761,10 +761,21 @@ func main() {
func (s *server) listDynamicRules(ctx context.Context) ([]DynamicRule, error) {
const q = `
SELECT id, name, description, severity, channel, event_ids,
match_field, match_operator, match_value,
threshold_count, threshold_window_seconds, suppress_for_seconds,
enabled, created_at, updated_at
SELECT id,
name,
COALESCE(description, ''),
severity,
channel,
event_ids,
COALESCE(match_field, ''),
COALESCE(match_operator, ''),
COALESCE(match_value, ''),
threshold_count,
threshold_window_seconds,
suppress_for_seconds,
enabled,
created_at,
updated_at
FROM detection_rules
ORDER BY name ASC
`