signal-desktop/ts/sql/migrations/74-optimize-convo-open.ts

24 lines
586 B
TypeScript
Raw Normal View History

2023-01-17 13:07:21 -08:00
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2025-03-12 14:45:54 -07:00
import type { Database } from '@signalapp/sqlcipher';
2023-01-17 13:07:21 -08:00
2025-08-06 10:32:08 -07:00
export default function updateToSchemaVersion74(db: Database): void {
db.exec(
`
-- Previously: (isUserInitiatedMessage)
DROP INDEX message_user_initiated;
2023-01-17 13:07:21 -08:00
2025-08-06 10:32:08 -07:00
CREATE INDEX message_user_initiated ON messages (conversationId, isUserInitiatedMessage);
2023-01-17 13:07:21 -08:00
2025-08-06 10:32:08 -07:00
-- Previously: (unread, conversationId)
DROP INDEX reactions_unread;
2023-01-17 13:07:21 -08:00
2025-08-06 10:32:08 -07:00
CREATE INDEX reactions_unread ON reactions (
conversationId,
unread
2023-01-17 13:07:21 -08:00
);
2025-08-06 10:32:08 -07:00
`
);
2023-01-17 13:07:21 -08:00
}