Skip to content

Build your personal knowledge base with Trilium Notes

fix consistency check

zadam42112b80538e
diff --git a/package-lock.json b/package-lock.json
index 42e29e6dd7..72968a5897 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "trilium",
- "version": "0.28.3",
+ "version": "0.29.0-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/src/services/consistency_checks.js b/src/services/consistency_checks.js
index d4bc19fd2a..d8eadd78c3 100644
--- a/src/services/consistency_checks.js
+++ b/src/services/consistency_checks.js
@@ -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}`);