Simplify database migrations
This commit is contained in:
parent
46d5b06bfc
commit
e6809c95db
106 changed files with 4661 additions and 6814 deletions
|
@ -1,31 +1,15 @@
|
|||
// 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!');
|
||||
export default function updateToSchemaVersion1370(db: WritableDB): void {
|
||||
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;
|
||||
`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue