mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
19 lines
630 B
TypeScript
19 lines
630 B
TypeScript
// Copyright 2025 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { Database } from '@signalapp/sqlcipher';
|
|
|
|
export default function updateToSchemaVersion1510(db: Database): void {
|
|
db.exec(`
|
|
-- Add hasUnreadPollVotes column to messages table
|
|
ALTER TABLE messages ADD COLUMN hasUnreadPollVotes INTEGER NOT NULL DEFAULT 0;
|
|
|
|
-- Create partial index for efficient queries
|
|
-- Only indexes rows where hasUnreadPollVotes = 1
|
|
CREATE INDEX messages_unread_poll_votes ON messages (
|
|
conversationId,
|
|
received_at
|
|
) WHERE hasUnreadPollVotes = 1 AND type IS 'outgoing';
|
|
`);
|
|
}
|