Skip to content

Build your personal knowledge base with Trilium Notes

make migration more robust, fixes #1271

zadam8f68b4f29807
diff --git a/db/migrations/0166__add_dateModified_to_note_content.sql b/db/migrations/0166__add_dateModified_to_note_content.sql
index 148eba7cef..f42ecaa018 100644
--- a/db/migrations/0166__add_dateModified_to_note_content.sql
+++ b/db/migrations/0166__add_dateModified_to_note_content.sql
@@ -11,7 +11,7 @@ INSERT INTO note_contents_mig (noteId, content, hash, dateModified, utcDateModif
SELECT noteId,
content,
hash,
- (SELECT dateModified FROM notes WHERE noteId = note_contents.noteId),
+ COALESCE((SELECT dateModified FROM notes WHERE noteId = note_contents.noteId), utcDateModified),
utcDateModified
FROM note_contents;