Receive support for editing messages

This commit is contained in:
Josh Perez 2023-03-27 19:48:57 -04:00 committed by GitHub
parent 2781e621ad
commit 36e21c0134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 2053 additions and 405 deletions

View file

@ -0,0 +1,34 @@
// 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 updateToSchemaVersion80(
currentVersion: number,
db: Database,
logger: LoggerType
): void {
if (currentVersion >= 80) {
return;
}
db.transaction(() => {
db.exec(`
CREATE TABLE edited_messages(
fromId STRING,
messageId STRING REFERENCES messages(id)
ON DELETE CASCADE,
sentAt INTEGER,
readStatus INTEGER
);
CREATE INDEX edited_messages_sent_at ON edited_messages (sentAt);
`);
db.pragma('user_version = 80');
})();
logger.info('updateToSchemaVersion80: success!');
}