diff --git a/db/migrations/0166__add_dateModified_to_note_content.sql b/db/migrations/0166__add_dateModified_to_note_content.sql index 148eba7ce..f42ecaa01 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;