upgradeSchema: New keepOnDisk option, used for edits

This commit is contained in:
Scott Nonnenberg 2024-01-08 16:31:24 -08:00
parent 661727c290
commit d1aa47544b
4 changed files with 27 additions and 17 deletions

View file

@ -111,7 +111,7 @@ type MigrationsModuleType = {
}>;
upgradeMessageSchema: (
attributes: MessageAttributesType,
options?: { maxVersion?: number }
options?: { maxVersion?: number; keepOnDisk?: boolean }
) => Promise<MessageAttributesType>;
writeMessageAttachments: (
message: MessageAttributesType
@ -266,24 +266,26 @@ export function initializeMigrations({
}),
upgradeMessageSchema: (
message: MessageAttributesType,
options: { maxVersion?: number } = {}
options: { maxVersion?: number; keepOnDisk?: boolean } = {}
) => {
const { maxVersion } = options;
const { maxVersion, keepOnDisk } = options;
return MessageType.upgradeSchema(message, {
writeNewAttachmentData,
getRegionCode,
deleteOnDisk,
getAbsoluteAttachmentPath,
makeObjectUrl,
revokeObjectUrl,
getAbsoluteStickerPath,
getImageDimensions,
getRegionCode,
makeImageThumbnail,
makeObjectUrl,
makeVideoScreenshot,
revokeObjectUrl,
writeNewAttachmentData,
writeNewStickerData,
keepOnDisk,
logger,
maxVersion,
getAbsoluteStickerPath,
writeNewStickerData,
deleteOnDisk,
});
},
writeMessageAttachments: MessageType.createAttachmentDataWriter({