mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Delete Sync: Handle and send mostRecentNonExpiringMessages if needed
This commit is contained in:
31
ts/sql/migrations/1080-nondisappearing-addressable.ts
Normal file
31
ts/sql/migrations/1080-nondisappearing-addressable.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Database } from '@signalapp/better-sqlite3';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
|
||||
export const version = 1080;
|
||||
|
||||
export function updateToSchemaVersion1080(
|
||||
currentVersion: number,
|
||||
db: Database,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 1080) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
db.exec(`
|
||||
CREATE INDEX messages_by_date_addressable_nondisappearing
|
||||
ON messages (
|
||||
conversationId, isAddressableMessage, received_at, sent_at
|
||||
) WHERE expireTimer IS NULL;
|
||||
`);
|
||||
})();
|
||||
|
||||
db.pragma('user_version = 1080');
|
||||
|
||||
logger.info('updateToSchemaVersion1080: success!');
|
||||
}
|
||||
@@ -82,10 +82,11 @@ import { updateToSchemaVersion1030 } from './1030-unblock-event';
|
||||
import { updateToSchemaVersion1040 } from './1040-undownloaded-backed-up-media';
|
||||
import { updateToSchemaVersion1050 } from './1050-group-send-endorsements';
|
||||
import { updateToSchemaVersion1060 } from './1060-addressable-messages-and-sync-tasks';
|
||||
import { updateToSchemaVersion1070 } from './1070-attachment-backup';
|
||||
import {
|
||||
updateToSchemaVersion1070,
|
||||
updateToSchemaVersion1080,
|
||||
version as MAX_VERSION,
|
||||
} from './1070-attachment-backup';
|
||||
} from './1080-nondisappearing-addressable';
|
||||
|
||||
function updateToSchemaVersion1(
|
||||
currentVersion: number,
|
||||
@@ -2036,6 +2037,7 @@ export const SCHEMA_VERSIONS = [
|
||||
updateToSchemaVersion1050,
|
||||
updateToSchemaVersion1060,
|
||||
updateToSchemaVersion1070,
|
||||
updateToSchemaVersion1080,
|
||||
];
|
||||
|
||||
export class DBVersionFromFutureError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user