Keep object stores after conversations migrate to SQLCipher
This commit is contained in:
parent
bc0ec92ad2
commit
7532f397ea
3 changed files with 15 additions and 24 deletions
|
@ -131,10 +131,7 @@
|
||||||
deleteAttachmentData,
|
deleteAttachmentData,
|
||||||
getCurrentVersion,
|
getCurrentVersion,
|
||||||
} = window.Signal.Migrations;
|
} = window.Signal.Migrations;
|
||||||
const {
|
const { Migrations0DatabaseWithAttachmentData } = window.Signal.Migrations;
|
||||||
Migrations0DatabaseWithAttachmentData,
|
|
||||||
Migrations1DatabaseWithoutAttachmentData,
|
|
||||||
} = window.Signal.Migrations;
|
|
||||||
const { Views } = window.Signal;
|
const { Views } = window.Signal;
|
||||||
|
|
||||||
// Implicitly used in `indexeddb-backbonejs-adapter`:
|
// Implicitly used in `indexeddb-backbonejs-adapter`:
|
||||||
|
@ -391,20 +388,6 @@
|
||||||
|
|
||||||
Views.Initialization.setMessage(window.i18n('optimizingApplication'));
|
Views.Initialization.setMessage(window.i18n('optimizingApplication'));
|
||||||
|
|
||||||
window.log.info('Running cleanup IndexedDB migrations...');
|
|
||||||
await Whisper.Database.close();
|
|
||||||
|
|
||||||
// Now we clean up IndexedDB database after extracting data from it
|
|
||||||
await Migrations1DatabaseWithoutAttachmentData.run({
|
|
||||||
Backbone,
|
|
||||||
logger: window.log,
|
|
||||||
});
|
|
||||||
|
|
||||||
const latestDBVersion = _.last(
|
|
||||||
Migrations1DatabaseWithoutAttachmentData.migrations
|
|
||||||
).version;
|
|
||||||
Whisper.Database.migrations[0].version = latestDBVersion;
|
|
||||||
|
|
||||||
window.log.info('Cleanup: starting...');
|
window.log.info('Cleanup: starting...');
|
||||||
const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt(
|
const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt(
|
||||||
{
|
{
|
||||||
|
@ -452,9 +435,6 @@
|
||||||
|
|
||||||
Views.Initialization.setMessage(window.i18n('loading'));
|
Views.Initialization.setMessage(window.i18n('loading'));
|
||||||
|
|
||||||
// Note: We are not invoking the second set of IndexedDB migrations because it is
|
|
||||||
// likely that any future migrations will simply extracting things from IndexedDB.
|
|
||||||
|
|
||||||
idleDetector = new IdleDetector();
|
idleDetector = new IdleDetector();
|
||||||
let isMigrationWithIndexComplete = false;
|
let isMigrationWithIndexComplete = false;
|
||||||
window.log.info(
|
window.log.info(
|
||||||
|
|
|
@ -165,6 +165,17 @@ const migrations = [
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
version: 19,
|
||||||
|
migrate(transaction, next) {
|
||||||
|
window.log.info('Migration 19');
|
||||||
|
|
||||||
|
// Empty because we don't want to cause incompatibility with users who have already
|
||||||
|
// run migration 19 when it was the object store removal.
|
||||||
|
|
||||||
|
next();
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const database = {
|
const database = {
|
||||||
|
|
|
@ -6,12 +6,12 @@ const db = require('../database');
|
||||||
const settings = require('../settings');
|
const settings = require('../settings');
|
||||||
const { runMigrations } = require('./run_migrations');
|
const { runMigrations } = require('./run_migrations');
|
||||||
|
|
||||||
// These are cleanup migrations, to be run after migration to SQLCipher
|
// These are migrations for after the SQLCipher migration, currently not running
|
||||||
exports.migrations = [
|
exports.migrations = [
|
||||||
{
|
{
|
||||||
version: 19,
|
version: 20,
|
||||||
migrate(transaction, next) {
|
migrate(transaction, next) {
|
||||||
window.log.info('Migration 19');
|
window.log.info('Migration 20');
|
||||||
window.log.info(
|
window.log.info(
|
||||||
'Removing messages, unprocessed, and conversations object stores'
|
'Removing messages, unprocessed, and conversations object stores'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue