Receive support for editing messages
This commit is contained in:
parent
2781e621ad
commit
36e21c0134
46 changed files with 2053 additions and 405 deletions
34
ts/sql/migrations/80-edited-messages.ts
Normal file
34
ts/sql/migrations/80-edited-messages.ts
Normal 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!');
|
||||
}
|
|
@ -55,6 +55,7 @@ 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';
|
||||
import updateToSchemaVersion80 from './80-edited-messages';
|
||||
|
||||
function updateToSchemaVersion1(
|
||||
currentVersion: number,
|
||||
|
@ -1979,6 +1980,8 @@ export const SCHEMA_VERSIONS = [
|
|||
updateToSchemaVersion77,
|
||||
updateToSchemaVersion78,
|
||||
updateToSchemaVersion79,
|
||||
|
||||
updateToSchemaVersion80,
|
||||
];
|
||||
|
||||
export function updateSchema(db: Database, logger: LoggerType): void {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue