From a5edbf8328930ea6437e91ee7bc6d18ff3b25468 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Wed, 14 Mar 2018 15:46:28 -0400 Subject: [PATCH] Initialize schema as first step in `upgradeSchema` --- js/modules/types/message.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/modules/types/message.js b/js/modules/types/message.js index c9f4696baaa..b0253d4a1ea 100644 --- a/js/modules/types/message.js +++ b/js/modules/types/message.js @@ -146,6 +146,9 @@ exports._mapAttachments = upgradeAttachment => async message => } ); +const toVersion0 = async message => + exports.initializeSchemaVersion(message); + const toVersion1 = exports._withSchemaVersion( 1, exports._mapAttachments(Attachment.autoOrientJPEG) @@ -157,4 +160,4 @@ const toVersion2 = exports._withSchemaVersion( // UpgradeStep exports.upgradeSchema = async message => - toVersion2(await toVersion1(message)); + toVersion2(await toVersion1(await toVersion0(message)));