@@ -86,10 +86,6 @@ FROM acquired nm
86
86
JOIN notification_templates nt ON nm .notification_template_id = nt .id ;
87
87
88
88
-- name: BulkMarkNotificationMessagesFailed :execrows
89
- WITH new_values AS (SELECT UNNEST(@ids::uuid[]) AS id,
90
- UNNEST(@failed_ats::timestamptz []) AS failed_at,
91
- UNNEST(@statuses::notification_message_status[]) AS status,
92
- UNNEST(@status_reasons::text []) AS status_reason)
93
89
UPDATE notification_messages
94
90
SET updated_at = subquery .failed_at ,
95
91
attempt_count = attempt_count + 1 ,
@@ -101,8 +97,10 @@ SET updated_at = subquery.failed_at,
101
97
next_retry_after = CASE
102
98
WHEN (attempt_count + 1 < @max_attempts::int )
103
99
THEN NOW() + CONCAT(@retry_interval::int , ' seconds' )::interval END
104
- FROM (SELECT id, status, status_reason, failed_at
105
- FROM new_values) AS subquery
100
+ FROM (SELECT UNNEST(@ids::uuid[]) AS id,
101
+ UNNEST(@failed_ats::timestamptz []) AS failed_at,
102
+ UNNEST(@statuses::notification_message_status[]) AS status,
103
+ UNNEST(@status_reasons::text []) AS status_reason) AS subquery
106
104
WHERE notification_messages .id = subquery .id ;
107
105
108
106
-- name: BulkMarkNotificationMessagesSent :execrows
0 commit comments