From 8f68b4f2980756861aceb828b62cf037e997862b Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 26 Sep 2020 23:25:35 +0200 Subject: [PATCH] make migration more robust, fixes #1271 --- db/migrations/0166__add_dateModified_to_note_content.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;