mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-03 14:51:18 +01:00
Page media in Lightbox
This commit is contained in:
32
ts/sql/migrations/79-paging-lightbox.ts
Normal file
32
ts/sql/migrations/79-paging-lightbox.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// 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 updateToSchemaVersion79(
|
||||
currentVersion: number,
|
||||
db: Database,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 79) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
db.exec(`
|
||||
DROP INDEX messages_hasVisualMediaAttachments;
|
||||
CREATE INDEX messages_hasVisualMediaAttachments
|
||||
ON messages (
|
||||
conversationId, isStory, storyId,
|
||||
hasVisualMediaAttachments, received_at, sent_at
|
||||
)
|
||||
WHERE hasVisualMediaAttachments IS 1;
|
||||
`);
|
||||
|
||||
db.pragma('user_version = 79');
|
||||
})();
|
||||
|
||||
logger.info('updateToSchemaVersion79: success!');
|
||||
}
|
||||
@@ -54,6 +54,7 @@ import updateToSchemaVersion75 from './75-noop';
|
||||
import updateToSchemaVersion76 from './76-optimize-convo-open-2';
|
||||
import updateToSchemaVersion77 from './77-signal-tokenizer';
|
||||
import updateToSchemaVersion78 from './78-merge-receipt-jobs';
|
||||
import updateToSchemaVersion79 from './79-paging-lightbox';
|
||||
|
||||
function updateToSchemaVersion1(
|
||||
currentVersion: number,
|
||||
@@ -1977,6 +1978,7 @@ export const SCHEMA_VERSIONS = [
|
||||
updateToSchemaVersion76,
|
||||
updateToSchemaVersion77,
|
||||
updateToSchemaVersion78,
|
||||
updateToSchemaVersion79,
|
||||
];
|
||||
|
||||
export function updateSchema(db: Database, logger: LoggerType): void {
|
||||
|
||||
Reference in New Issue
Block a user