Temporarily disable post-attachment migration migrations
This commit is contained in:
		
					parent
					
						
							
								d9be6a0f94
							
						
					
				
			
			
				commit
				
					
						bfbeedab5c
					
				
			
		
					 4 changed files with 27 additions and 27 deletions
				
			
		| 
						 | 
				
			
			@ -19,7 +19,7 @@
 | 
			
		|||
    const { upgradeMessageSchema } = window.Signal.Migrations;
 | 
			
		||||
    const {
 | 
			
		||||
        Migrations0DatabaseWithAttachmentData,
 | 
			
		||||
        Migrations1DatabaseWithoutAttachmentData,
 | 
			
		||||
        // Migrations1DatabaseWithoutAttachmentData,
 | 
			
		||||
    } = window.Signal.Migrations;
 | 
			
		||||
    const { Views } = window.Signal;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -86,20 +86,20 @@
 | 
			
		|||
  console.log('Migrate database with attachments');
 | 
			
		||||
  await Migrations0DatabaseWithAttachmentData.run({ Backbone });
 | 
			
		||||
 | 
			
		||||
  console.log('Migrate attachments to disk');
 | 
			
		||||
  const database = Migrations0DatabaseWithAttachmentData.getDatabase();
 | 
			
		||||
  await MessageDataMigrator.processAll({
 | 
			
		||||
    Backbone,
 | 
			
		||||
    databaseName: database.name,
 | 
			
		||||
    minDatabaseVersion: database.version,
 | 
			
		||||
    upgradeMessageSchema,
 | 
			
		||||
  });
 | 
			
		||||
  // console.log('Migrate attachments to disk');
 | 
			
		||||
  // const database = Migrations0DatabaseWithAttachmentData.getDatabase();
 | 
			
		||||
  // await MessageDataMigrator.processAll({
 | 
			
		||||
  //   Backbone,
 | 
			
		||||
  //   databaseName: database.name,
 | 
			
		||||
  //   minDatabaseVersion: database.version,
 | 
			
		||||
  //   upgradeMessageSchema,
 | 
			
		||||
  // });
 | 
			
		||||
 | 
			
		||||
  console.log('Migrate database without attachments');
 | 
			
		||||
  await Migrations1DatabaseWithoutAttachmentData.run({
 | 
			
		||||
    Backbone,
 | 
			
		||||
    database: Whisper.Database,
 | 
			
		||||
  });
 | 
			
		||||
  // console.log('Migrate database without attachments');
 | 
			
		||||
  // await Migrations1DatabaseWithoutAttachmentData.run({
 | 
			
		||||
  //   Backbone,
 | 
			
		||||
  //   database: Whisper.Database,
 | 
			
		||||
  // });
 | 
			
		||||
 | 
			
		||||
  console.log('Storage fetch');
 | 
			
		||||
  storage.fetch();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
(function () {
 | 
			
		||||
  'use strict';
 | 
			
		||||
 | 
			
		||||
  const { Migrations1DatabaseWithoutAttachmentData } = window.Signal.Migrations;
 | 
			
		||||
  const { Migrations0DatabaseWithAttachmentData } = window.Signal.Migrations;
 | 
			
		||||
 | 
			
		||||
  window.Whisper = window.Whisper || {};
 | 
			
		||||
  window.Whisper.Database = window.Whisper.Database || {};
 | 
			
		||||
| 
						 | 
				
			
			@ -123,5 +123,5 @@
 | 
			
		|||
      request.onsuccess = resolve;
 | 
			
		||||
    }));
 | 
			
		||||
 | 
			
		||||
  Whisper.Database.migrations = Migrations1DatabaseWithoutAttachmentData.migrations;
 | 
			
		||||
  Whisper.Database.migrations = Migrations0DatabaseWithAttachmentData.migrations;
 | 
			
		||||
}());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ const { runMigrations } = require('./run_migrations');
 | 
			
		|||
// any expensive operations, e.g. modifying all messages / attachments, etc., as
 | 
			
		||||
// it may cause out-of-memory errors for users with long histories:
 | 
			
		||||
// https://github.com/signalapp/Signal-Desktop/issues/2163
 | 
			
		||||
const migrations = [
 | 
			
		||||
exports.migrations = [
 | 
			
		||||
  {
 | 
			
		||||
    version: '12.0',
 | 
			
		||||
    migrate(transaction, next) {
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +144,7 @@ const migrations = [
 | 
			
		|||
const database = {
 | 
			
		||||
  id: 'signal',
 | 
			
		||||
  nolog: true,
 | 
			
		||||
  migrations,
 | 
			
		||||
  migrations: exports.migrations,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.run = ({ Backbone } = {}) =>
 | 
			
		||||
| 
						 | 
				
			
			@ -152,5 +152,5 @@ exports.run = ({ Backbone } = {}) =>
 | 
			
		|||
 | 
			
		||||
exports.getDatabase = () => ({
 | 
			
		||||
  name: database.id,
 | 
			
		||||
  version: last(migrations).version,
 | 
			
		||||
  version: last(exports.migrations).version,
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,14 +2,14 @@ const { runMigrations } = require('./run_migrations');
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
exports.migrations = [
 | 
			
		||||
  {
 | 
			
		||||
    version: 18,
 | 
			
		||||
    async migrate(transaction, next) {
 | 
			
		||||
      console.log('Migration 18');
 | 
			
		||||
      console.log('Attachments stored on disk');
 | 
			
		||||
      next();
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   version: 18,
 | 
			
		||||
  //   async migrate(transaction, next) {
 | 
			
		||||
  //     console.log('Migration 18');
 | 
			
		||||
  //     console.log('Attachments stored on disk');
 | 
			
		||||
  //     next();
 | 
			
		||||
  //   },
 | 
			
		||||
  // },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
exports.run = runMigrations;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue