From d7c79b0551bb555166071f7d75aba976a6da79eb Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Mon, 4 Nov 2024 15:46:03 +0000 Subject: [PATCH] alter sql to pull value out of array --- .../1730730955039_application_type_as_text_in_view/up.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hasura.planx.uk/migrations/1730730955039_application_type_as_text_in_view/up.sql b/hasura.planx.uk/migrations/1730730955039_application_type_as_text_in_view/up.sql index 040e6d924f..37c0dcec53 100644 --- a/hasura.planx.uk/migrations/1730730955039_application_type_as_text_in_view/up.sql +++ b/hasura.planx.uk/migrations/1730730955039_application_type_as_text_in_view/up.sql @@ -87,7 +87,7 @@ CREATE VIEW "public"."submission_services_summary" AS (ls.allow_list_answers -> 'service.type'::text) AS pre_app_service_type, (ls.allow_list_answers -> 'application.information.harmful'::text) AS pre_app_harmful_info, (ls.allow_list_answers -> 'application.information.sensitive'::text) AS pre_app_sensitive_info, - (ls.allow_list_answers ->> 'application.type')::text AS application_type + (ls.allow_list_answers -> 'application.type' -> 0)::text AS application_type FROM (((((((((lowcal_sessions ls LEFT JOIN flows f ON ((f.id = ls.flow_id))) LEFT JOIN teams t ON ((t.id = f.team_id))) @@ -152,7 +152,7 @@ CREATE VIEW "public"."analytics_summary" AS (al.allow_list_answers -> 'service.type'::text) AS pre_app_service_type, (al.allow_list_answers -> 'application.information.harmful'::text) AS pre_app_harmful_info, (al.allow_list_answers -> 'application.information.sensitive'::text) AS pre_app_sensitive_info, - (al.allow_list_answers ->> 'application.type')::text AS application_type + (al.allow_list_answers -> 'application.type' -> 0)::text AS application_type FROM (((analytics a LEFT JOIN analytics_logs al ON ((a.id = al.analytics_id))) LEFT JOIN flows f ON ((a.flow_id = f.id)))