From 66e8f149ea73e7eb24e534e0476fbee676b0b884 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 11 Apr 2024 15:19:24 +0200 Subject: [PATCH 1/2] feat: refs #6449 add summaryId --- config/logs.yml | 1 + mylogger.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/logs.yml b/config/logs.yml index 204a61b..6d35364 100644 --- a/config/logs.yml +++ b/config/logs.yml @@ -23,6 +23,7 @@ logs: - itemTag - name: item showField: name + showId: id logFields: - size exclude: diff --git a/mylogger.js b/mylogger.js index be2c508..d1ed9a0 100644 --- a/mylogger.js +++ b/mylogger.js @@ -80,7 +80,8 @@ module.exports = class MyLogger { oldInstance = ?, newInstance = ?, changedModelId = ?, - changedModelValue = ?` + changedModelValue = ?, + summaryId = ?` ); logInfo.fetchStmt = await db.prepare( `SELECT id FROM ${sqlTable} @@ -512,7 +513,7 @@ module.exports = class MyLogger { oldI = change.instance; break; } - + const summaryId = row[tableInfo.conf.showId]; const modelId = row[tableInfo.idName]; const modelValue = change.modelValue ?? null; const oldInstance = oldI ? JSON.stringify(oldI) : null; @@ -553,7 +554,8 @@ module.exports = class MyLogger { oldInstance, newI ? JSON.stringify(newI) : null, modelId, - modelValue + modelValue, + summaryId ]); } From 8e5c2af4ee6c5e55fd38db3faccc2511936bc42b Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 11 Jun 2024 15:50:18 +0200 Subject: [PATCH 2/2] feat: refs #6449 add summaryId on delete --- mylogger.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mylogger.js b/mylogger.js index d1ed9a0..cffc001 100644 --- a/mylogger.js +++ b/mylogger.js @@ -96,7 +96,8 @@ module.exports = class MyLogger { SET originFk = ?, creationDate = ?, oldInstance = ?, - changedModelValue = ? + changedModelValue = ?, + summaryId = ? WHERE id = ?` ); } @@ -539,6 +540,7 @@ module.exports = class MyLogger { created, oldInstance, modelValue, + summaryId, deleteRow.id ]); }