signal-desktop/ts/sql/migrations/1170-update-call-history-unread-index.ts

15 lines
494 B
TypeScript
Raw Normal View History

2024-08-27 06:20:23 -07:00
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2025-03-12 14:45:54 -07:00
import type { Database } from '@signalapp/sqlcipher';
2024-08-27 06:20:23 -07:00
import { sql } from '../util';
2025-08-06 10:32:08 -07:00
export default function updateToSchemaVersion1170(db: Database): void {
const [query] = sql`
DROP INDEX IF EXISTS messages_callHistory_markReadBefore;
CREATE INDEX messages_callHistory_markReadBefore
ON messages (type, seenStatus, received_at DESC)
WHERE type IS 'call-history';
`;
db.exec(query);
2024-08-27 06:20:23 -07:00
}