fix consistency check

This commit is contained in:
zadam
2019-02-03 16:22:45 +01:00
parent 6cc0dd5a80
commit 42112b8053
2 changed files with 2 additions and 2 deletions

View File

@@ -109,7 +109,7 @@ async function findBrokenReferenceIssues() {
// empty targetNoteId for relations is a special fixable case so not covered here
await findIssues(`
SELECT attributeId, attributes.noteId
SELECT attributeId, attributes.value AS noteId
FROM attributes LEFT JOIN notes ON notes.noteId = attributes.value
WHERE attributes.type = 'relation' AND attributes.value != '' AND notes.noteId IS NULL`,
({attributeId, noteId}) => `Relation ${attributeId} references missing note ${noteId}`);