From 0b626b3c544aec0cd1835f21903017099b8981dc Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Wed, 6 Nov 2024 12:24:41 +0100 Subject: [PATCH] database.files_db:FilesDB - update log_paths view to get paths for both original and master files --- acacore/database/files_db.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acacore/database/files_db.py b/acacore/database/files_db.py index 94a0b65..ebfde3a 100644 --- a/acacore/database/files_db.py +++ b/acacore/database/files_db.py @@ -101,7 +101,11 @@ def __init__( self.connection, EventPath, "log_paths", - f"select f.relative_path as file_relative_path, h.* from {self.log.name} h left join {self.original_files.name} f on f.uuid = h.uuid", + f""" + select coalesce(fo.relative_path, fm.relative_path) as file_relative_path, l.* from {self.log.name} l + left join {self.original_files.name} fo on l.file_type = 'original' and fo.uuid = l.uuid + left join {self.master_files.name} fm on l.file_type = 'master' and fm.uuid = l.uuid + """, ) self.identification_warnings: View[OriginalFile] = View(