mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
soft-deleting note will delete its content and all the revisions content, fixes #132
This commit is contained in:
parent
5b98c1c0f3
commit
7e4d70259f
@ -0,0 +1,2 @@
|
||||
UPDATE notes SET content = '' WHERE isDeleted = 1;
|
||||
UPDATE note_revisions SET content = '' WHERE (SELECT isDeleted FROM notes WHERE noteId = note_revisions.noteId) = 1;
|
@ -3,7 +3,7 @@
|
||||
const build = require('./build');
|
||||
const packageJson = require('../../package');
|
||||
|
||||
const APP_DB_VERSION = 104;
|
||||
const APP_DB_VERSION = 105;
|
||||
const SYNC_VERSION = 1;
|
||||
|
||||
module.exports = {
|
||||
|
@ -223,8 +223,14 @@ async function deleteNote(branch) {
|
||||
|
||||
if (notDeletedBranches.length === 0) {
|
||||
note.isDeleted = true;
|
||||
note.content = '';
|
||||
await note.save();
|
||||
|
||||
for (const noteRevision of await note.getRevisions()) {
|
||||
noteRevision.content = '';
|
||||
await noteRevision.save();
|
||||
}
|
||||
|
||||
for (const childBranch of await note.getChildBranches()) {
|
||||
await deleteNote(childBranch);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user