Migrate schema to service ids
This commit is contained in:
parent
71958f8a01
commit
8b0da36caa
258 changed files with 4795 additions and 2613 deletions
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
1254
ts/sql/migrations/88-service-ids.ts
Normal file
1254
ts/sql/migrations/88-service-ids.ts
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue