From 16bb62e0295e15c9cba78105e7ed097deb6a0f79 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 20 Jun 2018 14:51:24 +0100 Subject: [PATCH] Due to a bug in 2016, there are some rows without a template id. For that case use a default template id. --- app/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commands.py b/app/commands.py index 53cd3e0d2..eda6ae69e 100644 --- a/app/commands.py +++ b/app/commands.py @@ -597,7 +597,7 @@ def migrate_data_to_ft_notification_status(start_date, end_date): notification_status, created_at, notification_count) select (n.created_at at time zone 'UTC' at time zone 'Europe/London')::timestamp::date as bst_date, - n.template_id, + coalesce(n.template_id, '00000000-0000-0000-0000-000000000000') as template_id, n.service_id, coalesce(n.job_id, '00000000-0000-0000-0000-000000000000') as job_id, n.notification_type,