From 1e1fbbcef18e222586e2665392cf74448e6f5e46 Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Mon, 5 Dec 2022 12:21:56 +0000 Subject: [PATCH] Use the participant identity's external id --- analytics_queries/induction_tutors.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics_queries/induction_tutors.sql b/analytics_queries/induction_tutors.sql index bb93e016dc..d34379e9d6 100644 --- a/analytics_queries/induction_tutors.sql +++ b/analytics_queries/induction_tutors.sql @@ -6,7 +6,7 @@ u.full_name AS tutor_name, u.email AS tutor_email, (pp.id IS NOT NULL) AS sit_mentor, - u.id AS sit_mentor_id + pi.external_identifier AS sit_mentor_id FROM schools s @@ -18,4 +18,5 @@ ON tp.id = pp.teacher_profile_id AND pp.status = 'active' AND pp.type = 'ParticipantProfile::Mentor' + LEFT OUTER JOIN participant_identities pi on pp.participant_identity_id = pi.id ) to '/tmp/exports/induction_tutors.csv' with csv header;