-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a3ffe0
commit 1c22fe6
Showing
3 changed files
with
71 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2023 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import type { Database } from '@signalapp/better-sqlite3'; | ||
|
||
import type { LoggerType } from '../../types/Logging'; | ||
|
||
export default function updateToSchemaVersion74( | ||
currentVersion: number, | ||
db: Database, | ||
logger: LoggerType | ||
): void { | ||
if (currentVersion >= 74) { | ||
return; | ||
} | ||
|
||
db.transaction(() => { | ||
db.exec( | ||
` | ||
-- Previously: (isUserInitiatedMessage) | ||
DROP INDEX message_user_initiated; | ||
CREATE INDEX message_user_initiated ON messages (conversationId, isUserInitiatedMessage); | ||
-- Previously: (unread, conversationId) | ||
DROP INDEX reactions_unread; | ||
CREATE INDEX reactions_unread ON reactions ( | ||
conversationId, | ||
unread | ||
); | ||
` | ||
); | ||
|
||
db.pragma('user_version = 74'); | ||
})(); | ||
|
||
logger.info('updateToSchemaVersion74: success!'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters