Sync my stories with primary device

This commit is contained in:
Josh Perez 2022-06-30 20:52:03 -04:00 committed by GitHub
parent 7554d8326a
commit 9155784d56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 2954 additions and 1238 deletions

View file

@ -0,0 +1,44 @@
// 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 updateToSchemaVersion61(
currentVersion: number,
db: Database,
logger: LoggerType
): void {
if (currentVersion >= 61) {
return;
}
db.transaction(() => {
db.exec(
`
ALTER TABLE storyDistributions DROP COLUMN avatarKey;
ALTER TABLE storyDistributions DROP COLUMN avatarUrlPath;
ALTER TABLE storyDistributions ADD COLUMN deletedAtTimestamp INTEGER;
ALTER TABLE storyDistributions ADD COLUMN allowsReplies INTEGER;
ALTER TABLE storyDistributions ADD COLUMN isBlockList INTEGER;
ALTER TABLE storyDistributions ADD COLUMN storageID STRING;
ALTER TABLE storyDistributions ADD COLUMN storageVersion INTEGER;
ALTER TABLE storyDistributions ADD COLUMN storageUnknownFields BLOB;
ALTER TABLE storyDistributions ADD COLUMN storageNeedsSync INTEGER;
ALTER TABLE messages ADD COLUMN storyDistributionListId STRING;
CREATE INDEX messages_by_distribution_list
ON messages(storyDistributionListId, received_at)
WHERE storyDistributionListId IS NOT NULL;
`
);
db.pragma('user_version = 61');
})();
logger.info('updateToSchemaVersion61: success!');
}

View file

@ -36,6 +36,7 @@ import updateToSchemaVersion57 from './57-rm-message-history-unsynced';
import updateToSchemaVersion58 from './58-update-unread';
import updateToSchemaVersion59 from './59-unprocessed-received-at-counter-index';
import updateToSchemaVersion60 from './60-update-expiring-index';
import updateToSchemaVersion61 from './61-distribution-list-storage';
function updateToSchemaVersion1(
currentVersion: number,
@ -1935,6 +1936,7 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion58,
updateToSchemaVersion59,
updateToSchemaVersion60,
updateToSchemaVersion61,
];
export function updateSchema(db: Database, logger: LoggerType): void {