Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Remove the seeded alert/incident notification recipient config rows.
DELETE FROM utm_configuration_parameter WHERE conf_param_short IN (
'utmstack.alerts.notification_to',
'utmstack.alerts.notification_cc'
);
18 changes: 18 additions & 0 deletions backend/migrations/000003_alert_notification_recipients.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- 000003_alert_notification_recipients.up.sql
--
-- Seed the two config rows that hold the global alert/incident email recipients.
-- Both are optional, comma-separated lists. When both are empty the incident
-- mailer falls back to every activated user (see modules/incidents mailer).
--
-- The appconfig usecase only UPDATEs pre-seeded rows, so these must exist for
-- GET/PUT /config/<key> to work.
INSERT INTO utm_configuration_parameter
(conf_param_short, conf_param_large, conf_param_description, conf_param_value, conf_param_required, conf_param_datatype, conf_param_option)
SELECT v.conf_param_short, v.conf_param_large, v.conf_param_description, v.conf_param_value, v.conf_param_required, v.conf_param_datatype, v.conf_param_option
FROM (VALUES
('utmstack.alerts.notification_to', 'Alerts notification To', 'Comma-separated addresses that receive alert/incident notifications. Empty falls back to every activated user.', '', false, 'text', NULL),
('utmstack.alerts.notification_cc', 'Alerts notification Cc', 'Comma-separated addresses copied on alert/incident notifications.', '', false, 'text', NULL)
) AS v(conf_param_short, conf_param_large, conf_param_description, conf_param_value, conf_param_required, conf_param_datatype, conf_param_option)
WHERE NOT EXISTS (
SELECT 1 FROM utm_configuration_parameter c WHERE c.conf_param_short = v.conf_param_short
);
Loading