implemented consistency checks

This commit is contained in:
azivner
2017-12-14 22:16:26 -05:00
parent 581f406a24
commit d1329de760
9 changed files with 76 additions and 7 deletions

View File

@@ -188,7 +188,7 @@ async function checkCycle(parentNoteId, childNoteId) {
return false;
}
const parentNoteIds = await sql.getFlattenedResults("note_pid", "SELECT DISTINCT note_pid FROM notes_tree WHERE note_id = ?", [parentNoteId]);
const parentNoteIds = await sql.getFlattenedResults("SELECT DISTINCT note_pid FROM notes_tree WHERE note_id = ?", [parentNoteId]);
for (const pid of parentNoteIds) {
if (!await checkCycle(pid, childNoteId)) {