From 8be328cb3b1ce1667b328e5e8ae919c69b9fe15f Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 9 Nov 2018 09:04:55 +0100 Subject: [PATCH] now that content is nullable, cleanup sets it to null instead of empty string --- src/services/notes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/notes.js b/src/services/notes.js index 0c84b59b5..fb2923925 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -345,14 +345,14 @@ async function cleanupDeletedNotes() { const notesForCleanup = await repository.getEntities("SELECT * FROM notes WHERE isDeleted = 1 AND content != '' AND dateModified <= ?", [dateUtils.dateStr(cutoffDate)]); for (const note of notesForCleanup) { - note.content = ''; + note.content = null; await note.save(); } const notesRevisionsForCleanup = await repository.getEntities("SELECT note_revisions.* FROM notes JOIN note_revisions USING(noteId) WHERE notes.isDeleted = 1 AND note_revisions.content != '' AND notes.dateModified <= ?", [dateUtils.dateStr(cutoffDate)]); for (const noteRevision of notesRevisionsForCleanup) { - noteRevision.content = ''; + noteRevision.content = null; await noteRevision.save(); } }