mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 10:58:19 +01:00
Stop round-tripping wallpaper data
This commit is contained in:
41
ts/sql/migrations/1410-remove-wallpaper.ts
Normal file
41
ts/sql/migrations/1410-remove-wallpaper.ts
Normal 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!');
|
||||
}
|
||||
@@ -115,10 +115,11 @@ import { updateToSchemaVersion1360 } from './1360-attachments';
|
||||
import { updateToSchemaVersion1370 } from './1370-message-attachment-indexes';
|
||||
import { updateToSchemaVersion1380 } from './1380-donation-receipts';
|
||||
import { updateToSchemaVersion1390 } from './1390-attachment-download-keys';
|
||||
import { updateToSchemaVersion1400 } from './1400-simplify-receipts';
|
||||
import {
|
||||
updateToSchemaVersion1400,
|
||||
updateToSchemaVersion1410,
|
||||
version as MAX_VERSION,
|
||||
} from './1400-simplify-receipts';
|
||||
} from './1410-remove-wallpaper';
|
||||
|
||||
import { DataWriter } from '../Server';
|
||||
|
||||
@@ -2113,6 +2114,7 @@ export const SCHEMA_VERSIONS = [
|
||||
updateToSchemaVersion1390,
|
||||
|
||||
updateToSchemaVersion1400,
|
||||
updateToSchemaVersion1410,
|
||||
];
|
||||
|
||||
export class DBVersionFromFutureError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user