diff --git a/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml b/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml
index 526cb2feb..af7acccd2 100644
--- a/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml
+++ b/.idea/dataSources/a2c75661-f9e2-478f-a69f-6a9409e69997.xml
@@ -57,7 +57,6 @@
1
apiTokenId
-
1
@@ -126,25 +125,20 @@
1
attributeId
-
1
noteId
-
name
value
-
name
-
value
-
attributeId
@@ -206,21 +200,17 @@ value
1
branchId
-
1
noteId
parentNoteId
-
noteId
-
parentNoteId
-
branchId
@@ -251,7 +241,6 @@ parentNoteId
1
noteId
-
1
@@ -282,7 +271,6 @@ parentNoteId
1
noteRevisionId
-
1
@@ -367,28 +355,22 @@ parentNoteId
1
noteRevisionId
-
1
noteId
-
utcDateLastEdited
-
utcDateCreated
-
dateLastEdited
-
dateCreated
-
noteRevisionId
@@ -470,36 +452,28 @@ parentNoteId
1
noteId
-
1
title
-
type
-
isDeleted
-
dateCreated
-
dateModified
-
utcDateCreated
-
utcDateModified
-
noteId
@@ -540,7 +514,6 @@ parentNoteId
1
name
-
1
@@ -576,7 +549,6 @@ parentNoteId
1
noteId
-
1
@@ -597,7 +569,6 @@ parentNoteId
1
sourceId
-
1
@@ -660,12 +631,10 @@ parentNoteId
entityName
entityId
-
1
utcSyncDate
-
id
diff --git a/db/migrations/0151__add_isErased_to_note.sql b/db/migrations/0151__add_isErased_to_note.sql
index 9cd860697..ae996c6ab 100644
--- a/db/migrations/0151__add_isErased_to_note.sql
+++ b/db/migrations/0151__add_isErased_to_note.sql
@@ -20,7 +20,7 @@ DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes;
UPDATE notes SET isErased = 1 WHERE isDeleted = 1
-AND 1=(SELECT CASE content WHEN NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.noteId);
+AND 1=(SELECT CASE WHEN content IS NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.noteId);
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
diff --git a/src/services/consistency_checks.js b/src/services/consistency_checks.js
index 73f6725fd..520d1cdf9 100644
--- a/src/services/consistency_checks.js
+++ b/src/services/consistency_checks.js
@@ -32,12 +32,17 @@ async function findAndFixIssues(query, fixerCb) {
for (const res of results) {
const autoFix = await optionsService.getOptionBool('autoFixConsistencyIssues');
- await fixerCb(res, autoFix);
+ try {
+ await fixerCb(res, autoFix);
- if (autoFix) {
- fixedIssues = true;
+ if (autoFix) {
+ fixedIssues = true;
+ } else {
+ unrecoveredConsistencyErrors = true;
+ }
}
- else {
+ catch (e) {
+ logError(`Fixer failed with ${e.message} ${e.stack}`);
unrecoveredConsistencyErrors = true;
}
}