Stop round-tripping wallpaper data

This commit is contained in:
trevor-signal
2025-07-17 11:20:00 -04:00
committed by GitHub
parent e6a57f69d8
commit f471b75a5f
5 changed files with 201 additions and 12 deletions

View File

@@ -0,0 +1,41 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { LoggerType } from '../../types/Logging';
import { type WritableDB } from '../Interface';
export const version = 1410;
export function updateToSchemaVersion1410(
currentVersion: number,
db: WritableDB,
logger: LoggerType
): void {
if (currentVersion >= 1410) {
return;
}
db.transaction(() => {
db.exec(`
UPDATE conversations
SET json = json_remove(json,
'$.wallpaperPreset',
'$.wallpaperPhotoPointerBase64',
'$.dimWallpaperInDarkMode',
'$.autoBubbleColor'
);
DELETE FROM items
WHERE id IN (
'defaultWallpaperPhotoPointer',
'defaultWallpaperPreset',
'defaultDimWallpaperInDarkMode',
'defaultAutoBubbleColor'
);
`);
db.pragma('user_version = 1410');
})();
logger.info('updateToSchemaVersion1410: success!');
}