From 475569eb1bc4183c58a5acf6092a4da5dadf2927 Mon Sep 17 00:00:00 2001 From: Bhattarapong Somwong Date: Wed, 26 Jun 2024 17:22:26 +0700 Subject: [PATCH] #2037 correctly export rfm classification details --- apps/cli/src/backup/projects/export/queries.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/cli/src/backup/projects/export/queries.ts b/apps/cli/src/backup/projects/export/queries.ts index 9f26a48ba..83888115d 100644 --- a/apps/cli/src/backup/projects/export/queries.ts +++ b/apps/cli/src/backup/projects/export/queries.ts @@ -186,9 +186,16 @@ export const RFM_CLASSIFICATIONS = ` st.songtype, cr.present from classification_results cr - join job_params_classification jpc on cr.job_id = jpc.job_id - join models m on jpc.model_id = m.model_id - join songtypes st on cr.songtype_id = st.songtype_id - join species sp on cr.species_id = sp.species_id - where m.model_type_id = 4 and m.project_id = $projectId and m.deleted = 0 + join job_params_classification jpc on cr.job_id = jpc.job_id + join jobs j on jpc.job_id = j.job_id + join models m on jpc.model_id = m.model_id + join songtypes st on cr.songtype_id = st.songtype_id + join species sp on cr.species_id = sp.species_id + where + m.project_id = $projectId and + m.deleted = 0 and + m.model_type_id = 4 and + j.job_type_id = 2 and + j.state = 'completed' and + j.completed = 1 `