mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Use attachments from old CollectionFS database structure, when not yet migrated to Meteor-Files/ostrio-files, without needing to migrate database structure.
Thanks to xet7 !
This commit is contained in:
parent
dda013844c
commit
a8de2f224f
6 changed files with 698 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
import { AttachmentStoreStrategyFilesystem, AttachmentStoreStrategyGridFs, AttachmentStoreStrategyS3 } from '/models/lib/attachmentStoreStrategy';
|
||||
import FileStoreStrategyFactory, {moveToStorage, rename, STORAGE_NAME_FILESYSTEM, STORAGE_NAME_GRIDFS, STORAGE_NAME_S3} from '/models/lib/fileStoreStrategy';
|
||||
import { getAttachmentWithBackwardCompatibility, getAttachmentsWithBackwardCompatibility } from './lib/attachmentBackwardCompatibility';
|
||||
|
||||
let attachmentUploadExternalProgram;
|
||||
let attachmentUploadMimeTypes = [];
|
||||
|
|
@ -193,6 +194,10 @@ if (Meteor.isServer) {
|
|||
fs.mkdirSync(storagePath, { recursive: true });
|
||||
}
|
||||
});
|
||||
|
||||
// Add backward compatibility methods
|
||||
Attachments.getAttachmentWithBackwardCompatibility = getAttachmentWithBackwardCompatibility;
|
||||
Attachments.getAttachmentsWithBackwardCompatibility = getAttachmentsWithBackwardCompatibility;
|
||||
}
|
||||
|
||||
export default Attachments;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue