Update message attachment migration

This commit is contained in:
trevor-signal 2025-06-02 17:16:37 -04:00 committed by GitHub
commit 115b79e4ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 97 additions and 90 deletions

View file

@ -0,0 +1,31 @@
// 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 = 1370;
export function updateToSchemaVersion1370(
currentVersion: number,
db: WritableDB,
logger: LoggerType
): void {
if (currentVersion >= 1370) {
return;
}
db.transaction(() => {
db.exec(`
DROP INDEX IF EXISTS message_attachments_messageId;
DROP INDEX IF EXISTS message_attachments_plaintextHash;
DROP INDEX IF EXISTS message_attachments_path;
DROP INDEX IF EXISTS message_attachments_all_thumbnailPath;
DROP INDEX IF EXISTS message_attachments_all_screenshotPath;
DROP INDEX IF EXISTS message_attachments_all_backupThumbnailPath;
`);
db.pragma('user_version = 1370');
})();
logger.info('updateToSchemaVersion1370: success!');
}