Migrate schema to service ids

This commit is contained in:
Fedor Indutny 2023-08-16 22:54:39 +02:00 committed by Jamie Kyle
parent 71958f8a01
commit 8b0da36caa
258 changed files with 4795 additions and 2613 deletions

View file

@ -16,7 +16,22 @@ import {
objectToJSON,
} from '../util';
import type { EmptyQuery, Query } from '../util';
import type { MessageType, ConversationType } from '../Interface';
type MessageType = Readonly<{
id: string;
sourceUuid: string;
groupV2Change?: {
from?: string;
details: Array<{ type: string }>;
};
invitedGV2Members?: Array<{ uuid: string }>;
}>;
type ConversationType = Readonly<{
id: string;
members: Array<string>;
membersV2: Array<{ uuid: string }>;
}>;
export default function updateToSchemaVersion43(
currentVersion: number,

View file

@ -4,10 +4,8 @@
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import type { ServiceIdString } from '../../types/ServiceId';
import { jsonToObject } from '../util';
import type { EmptyQuery } from '../util';
import type { ConversationType } from '../Interface';
export default function updateToSchemaVersion53(
currentVersion: number,
@ -21,7 +19,13 @@ export default function updateToSchemaVersion53(
type LegacyConversationType = {
id: string;
groupId: string;
bannedMembersV2?: Array<ServiceIdString>;
bannedMembersV2?: Array<string>;
};
type ConversationType = {
id: string;
groupId: string;
bannedMembersV2?: Array<{ uuid: string; timestamp: number }>;
};
const updateConversationStmt = db.prepare(

File diff suppressed because it is too large Load diff

View file

@ -63,6 +63,7 @@ import updateToSchemaVersion84 from './84-all-mentions';
import updateToSchemaVersion85 from './85-add-kyber-keys';
import updateToSchemaVersion86 from './86-story-replies-index';
import updateToSchemaVersion87 from './87-calls-history-table';
import updateToSchemaVersion88 from './88-service-ids';
function updateToSchemaVersion1(
currentVersion: number,
@ -1996,6 +1997,7 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion85,
updateToSchemaVersion86,
updateToSchemaVersion87,
updateToSchemaVersion88,
];
export function updateSchema(db: Database, logger: LoggerType): void {