fix setting isErased after note migration

This commit is contained in:
zadam 2019-11-11 23:37:46 +01:00
parent 4ba7e74b58
commit 7bd1d8feb4
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ DROP TABLE notes;
ALTER TABLE notes_mig RENAME TO notes; ALTER TABLE notes_mig RENAME TO notes;
UPDATE notes SET isErased = 1 WHERE isDeleted = 1 UPDATE notes SET isErased = 1 WHERE isDeleted = 1
AND (SELECT CASE content WHEN NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.noteId); AND 1=(SELECT CASE content WHEN 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_isDeleted` ON `notes` (`isDeleted`);
CREATE INDEX `IDX_notes_title` ON `notes` (`title`); CREATE INDEX `IDX_notes_title` ON `notes` (`title`);

View file

@ -364,7 +364,7 @@ async function findLogicIssues() {
AND content IS NULL`, AND content IS NULL`,
async ({noteRevisionId}, autoFix) => { async ({noteRevisionId}, autoFix) => {
if (autoFix) { if (autoFix) {
const noteRevision = await repository.getNote(noteRevisionId); const noteRevision = await repository.getNoteRevision(noteRevisionId);
await noteRevision.setContent(''); await noteRevision.setContent('');
logFix(`Note revision ${noteRevisionId} content was set to empty string since it was null even though it is not erased`); logFix(`Note revision ${noteRevisionId} content was set to empty string since it was null even though it is not erased`);