mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Improve Processing of Sync Tasks
This commit is contained in:
29
ts/sql/migrations/1330-sync-tasks-type-index.ts
Normal file
29
ts/sql/migrations/1330-sync-tasks-type-index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import type { Database } from '@signalapp/better-sqlite3';
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
import { sql } from '../util';
|
||||
|
||||
export const version = 1330;
|
||||
|
||||
export function updateToSchemaVersion1330(
|
||||
currentVersion: number,
|
||||
db: Database,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 1330) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
const [query] = sql`
|
||||
CREATE INDEX syncTasks_type ON syncTasks (type);
|
||||
`;
|
||||
|
||||
db.exec(query);
|
||||
|
||||
db.pragma('user_version = 1330');
|
||||
})();
|
||||
|
||||
logger.info('updateToSchemaVersion1330: success!');
|
||||
}
|
||||
@@ -108,10 +108,12 @@ import { updateToSchemaVersion1280 } from './1280-blob-unprocessed';
|
||||
import { updateToSchemaVersion1290 } from './1290-int-unprocessed-source-device';
|
||||
import { updateToSchemaVersion1300 } from './1300-sticker-pack-refs';
|
||||
import { updateToSchemaVersion1310 } from './1310-muted-fixup';
|
||||
import { updateToSchemaVersion1320 } from './1320-unprocessed-received-at-date';
|
||||
import {
|
||||
updateToSchemaVersion1320,
|
||||
updateToSchemaVersion1330,
|
||||
version as MAX_VERSION,
|
||||
} from './1320-unprocessed-received-at-date';
|
||||
} from './1330-sync-tasks-type-index';
|
||||
|
||||
import { DataWriter } from '../Server';
|
||||
|
||||
function updateToSchemaVersion1(
|
||||
@@ -2091,6 +2093,7 @@ export const SCHEMA_VERSIONS = [
|
||||
updateToSchemaVersion1300,
|
||||
updateToSchemaVersion1310,
|
||||
updateToSchemaVersion1320,
|
||||
updateToSchemaVersion1330,
|
||||
];
|
||||
|
||||
export class DBVersionFromFutureError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user