diff --git a/notification_log.go b/notification_log.go index c6d0a71..5445833 100644 --- a/notification_log.go +++ b/notification_log.go @@ -48,7 +48,7 @@ func notificationsSent(from, to time.Time) (nss []NotificationSend, err error) { n.prio, n.service, - t.name AS trigger_name, + COALESCE(t.name, '') AS trigger_name, ns.id, ns.uuid, @@ -59,8 +59,8 @@ func notificationsSent(from, to time.Time) (nss []NotificationSend, err error) { FROM public.notification_send ns INNER JOIN notification n ON ns.notification_id = n.id - INNER JOIN problem p ON ns.problem_id = p.id - INNER JOIN "trigger" t ON p.trigger_id = t.id + LEFT JOIN problem p ON ns.problem_id = p.id + LEFT JOIN "trigger" t ON p.trigger_id = t.id WHERE ns.send >= $1 AND ns.send <= $2