-
-
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.
Order unprocessed envelopes by receivedAtCounter
- Loading branch information
1 parent
924c271
commit 6aeddb9
Showing
6 changed files
with
50 additions
and
14 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
28 changes: 28 additions & 0 deletions
28
ts/sql/migrations/59-unprocessed-received-at-counter-index.ts
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,28 @@ | ||
// Copyright 2022 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import type { Database } from 'better-sqlite3'; | ||
|
||
import type { LoggerType } from '../../types/Logging'; | ||
|
||
export default function updateToSchemaVersion59( | ||
currentVersion: number, | ||
db: Database, | ||
logger: LoggerType | ||
): void { | ||
if (currentVersion >= 59) { | ||
return; | ||
} | ||
|
||
db.transaction(() => { | ||
db.exec( | ||
` | ||
CREATE INDEX unprocessed_byReceivedAtCounter ON unprocessed | ||
(receivedAtCounter) | ||
` | ||
); | ||
|
||
db.pragma('user_version = 59'); | ||
})(); | ||
logger.info('updateToSchemaVersion59: 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
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
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