Update message attachment migration
This commit is contained in:
parent
a034045935
commit
115b79e4ac
8 changed files with 97 additions and 90 deletions
31
ts/sql/migrations/1370-message-attachment-indexes.ts
Normal file
31
ts/sql/migrations/1370-message-attachment-indexes.ts
Normal 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!');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue