Show and log progress during the SQLCipher migration

This commit is contained in:
Scott Nonnenberg 2018-08-01 18:34:50 -07:00
parent 6b78f2582b
commit 1d7987108b
7 changed files with 98 additions and 24 deletions

View file

@ -4,6 +4,7 @@ const ITEMS_STORE_NAME = 'items';
const LAST_PROCESSED_INDEX_KEY = 'attachmentMigration_lastProcessedIndex';
const IS_MIGRATION_COMPLETE_KEY = 'attachmentMigration_isComplete';
const MESSAGE_LAST_INDEX_KEY = 'sqlMigration_messageLastIndex';
const MESSAGE_COUNT_KEY = 'sqlMigration_messageCount';
const UNPROCESSED_LAST_INDEX_KEY = 'sqlMigration_unprocessedLastIndex';
// Public API
@ -25,6 +26,10 @@ exports.getMessageExportLastIndex = connection =>
exports._getItem(connection, MESSAGE_LAST_INDEX_KEY);
exports.setMessageExportLastIndex = (connection, lastIndex) =>
exports._setItem(connection, MESSAGE_LAST_INDEX_KEY, lastIndex);
exports.getMessageExportCount = connection =>
exports._getItem(connection, MESSAGE_COUNT_KEY);
exports.setMessageExportCount = (connection, count) =>
exports._setItem(connection, MESSAGE_COUNT_KEY, count);
exports.getUnprocessedExportLastIndex = connection =>
exports._getItem(connection, UNPROCESSED_LAST_INDEX_KEY);