mirror of
https://github.com/zadam/trilium.git
synced 2025-01-07 15:49:01 +08:00
now that content is nullable, cleanup sets it to null instead of empty string
This commit is contained in:
parent
bfc09187e3
commit
8be328cb3b
1 changed files with 2 additions and 2 deletions
|
@ -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)]);
|
const notesForCleanup = await repository.getEntities("SELECT * FROM notes WHERE isDeleted = 1 AND content != '' AND dateModified <= ?", [dateUtils.dateStr(cutoffDate)]);
|
||||||
|
|
||||||
for (const note of notesForCleanup) {
|
for (const note of notesForCleanup) {
|
||||||
note.content = '';
|
note.content = null;
|
||||||
await note.save();
|
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)]);
|
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) {
|
for (const noteRevision of notesRevisionsForCleanup) {
|
||||||
noteRevision.content = '';
|
noteRevision.content = null;
|
||||||
await noteRevision.save();
|
await noteRevision.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue