From af91e7a820b9d9ab45af674b53b7ccead0449cb1 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 19 Nov 2024 16:54:07 +0000 Subject: [PATCH] incorporate feedback changes --- .../down.sql | 4 ++-- .../up.sql | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/down.sql b/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/down.sql index 3a91c28957..3205618e04 100644 --- a/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/down.sql +++ b/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/down.sql @@ -1,6 +1,5 @@ alter table "public"."analytics_logs" drop column "has_clicked_save"; - CREATE OR REPLACE VIEW "public"."analytics_summary" AS SELECT a.id AS analytics_id, al.id AS analytics_log_id, @@ -52,9 +51,10 @@ CREATE OR REPLACE VIEW "public"."analytics_summary" AS ((al.allow_list_answers -> 'application.information.harmful'::text))::text AS pre_app_harmful_info, ((al.allow_list_answers -> 'application.information.sensitive'::text))::text AS pre_app_sensitive_info, (((al.allow_list_answers -> 'application.type'::text) -> 0))::text AS application_type, + ((al.allow_list_answers -> '_feedback') ->> 'feedbackScore'::text)::int AS feedback_score FROM (((analytics a LEFT JOIN analytics_logs al ON ((a.id = al.analytics_id))) LEFT JOIN flows f ON ((a.flow_id = f.id))) LEFT JOIN teams t ON ((t.id = f.team_id))); - GRANT SELECT ON "public"."analytics_summary" TO metabase_read_only; +GRANT SELECT ON "public"."analytics_summary" TO metabase_read_only; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/up.sql b/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/up.sql index e03de6c548..2e249c7ad6 100644 --- a/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/up.sql +++ b/hasura.planx.uk/migrations/1732016907414_alter_table_public_analytics_logs_add_column_has_user_clicked_save/up.sql @@ -52,6 +52,7 @@ CREATE OR REPLACE VIEW "public"."analytics_summary" AS ((al.allow_list_answers -> 'application.information.harmful'::text))::text AS pre_app_harmful_info, ((al.allow_list_answers -> 'application.information.sensitive'::text))::text AS pre_app_sensitive_info, (((al.allow_list_answers -> 'application.type'::text) -> 0))::text AS application_type, + ((al.allow_list_answers -> '_feedback') ->> 'feedbackScore'::text)::int AS feedback_score, al.has_clicked_save FROM (((analytics a LEFT JOIN analytics_logs al ON ((a.id = al.analytics_id)))