fix isProtected consistency for images and files + related consistency check

This commit is contained in:
zadam
2019-03-08 22:25:12 +01:00
parent ae17e4dc60
commit a432ad7483
4 changed files with 20 additions and 8 deletions

View File

@@ -357,6 +357,13 @@ async function findLogicIssues() {
logFix(`Removed link ${linkId} because target note ${targetNoteId} is also deleted.`);
});
await findIssues(`
SELECT noteId
FROM notes
JOIN note_contents USING(noteId)
WHERE notes.isDeleted = 0 AND notes.isProtected != note_contents.isProtected`,
({noteId}) => `Note ${noteId} has inconsistent isProtected in notes and note_contents tables`);
}
async function runSyncRowChecks(entityName, key) {