signal-desktop/ts/sql/migrations/60-update-expiring-index.ts

25 lines
591 B
TypeScript
Raw Normal View History

2023-01-03 11:55:46 -08:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2025-03-12 14:45:54 -07:00
import type { Database } from '@signalapp/sqlcipher';
// TODO: DESKTOP-3694
2025-08-06 10:32:08 -07:00
export default function updateToSchemaVersion60(db: Database): void {
db.exec(
`
DROP INDEX expiring_message_by_conversation_and_received_at;
2025-08-06 10:32:08 -07:00
CREATE INDEX expiring_message_by_conversation_and_received_at
ON messages
(
conversationId,
storyId,
expirationStartTimestamp,
expireTimer,
received_at
)
WHERE isStory IS 0 AND type IS 'incoming';
`
);
}