Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
don't set date modified on erasing
zadam0e2f8b57344c
diff --git a/src/services/notes.js b/src/services/notes.jsindex a5b47bac1a..6eb3540852 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -462,39 +462,31 @@ async function eraseDeletedNotes() {return;}- const utcNowDateTime = dateUtils.utcNowDateTime();- const localNowDateTime = dateUtils.localNowDateTime();-// it's better to not use repository for this because it will complain about saving protected notes- // out of protected session+ // out of protected session, also we don't want these changes to be synced (since they are done on all instances anyway)// setting contentLength to zero would serve no benefit and it leaves potentially useful trailawait sql.executeMany(`UPDATE notes- SET isErased = 1,- utcDateModified = '${utcNowDateTime}',- dateModified = '${localNowDateTime}'+ SET isErased = 1WHERE noteId IN (???)`, noteIdsToErase);await sql.executeMany(`UPDATE note_contents- SET content = NULL,- utcDateModified = '${utcNowDateTime}'+ SET content = NULLWHERE noteId IN (???)`, noteIdsToErase);// deleting first contents since the WHERE relies on isErased = 0await sql.executeMany(`UPDATE note_revision_contents- SET content = NULL,- utcDateModified = '${utcNowDateTime}'+ SET content = NULLWHERE noteRevisionId IN(SELECT noteRevisionId FROM note_revisions WHERE isErased = 0 AND noteId IN (???))`, noteIdsToErase);await sql.executeMany(`UPDATE note_revisionsSET isErased = 1,- title = NULL,- utcDateModified = '${utcNowDateTime}'+ title = NULLWHERE isErased = 0 AND noteId IN (???)`, noteIdsToErase);}