added consistency check for search note not containing children

This commit is contained in:
azivner 2018-03-13 19:18:52 -04:00
parent f1b0b3bcdb
commit 0fd5102a26

View File

@ -217,6 +217,16 @@ async function runAllChecks() {
type != 'text' AND type != 'code' AND type != 'render' AND type != 'file' AND type != 'search'`, type != 'text' AND type != 'code' AND type != 'render' AND type != 'file' AND type != 'search'`,
"Note has invalid type", errorList); "Note has invalid type", errorList);
await runCheck(`
SELECT
parentNoteId
FROM
note_tree
JOIN notes ON notes.noteId = note_tree.parentNoteId
WHERE
type == 'search'`,
"Search note has children", errorList);
await runSyncRowChecks("notes", "noteId", errorList); await runSyncRowChecks("notes", "noteId", errorList);
await runSyncRowChecks("note_revisions", "noteRevisionId", errorList); await runSyncRowChecks("note_revisions", "noteRevisionId", errorList);
await runSyncRowChecks("note_tree", "noteTreeId", errorList); await runSyncRowChecks("note_tree", "noteTreeId", errorList);