From 3300bbe9e7a6c02c753b0d1f2e8547d1d85cb76c Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 25 Apr 2023 03:32:31 +0300 Subject: [PATCH] Revert some migration filename changes. Thanks to xet7 ! --- server/migrations.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/migrations.js b/server/migrations.js index c179565a9..8c76ed416 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -1254,7 +1254,8 @@ Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => { // const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`); // NEW: Save file only with filename of ObjectID, not including filename. // Fixes https://github.com/wekan/wekan/issues/4416#issuecomment-1510517168 - const filePath = path.join(storagePath, `${fileObj._id}`); + //const filePath = path.join(storagePath, `${fileObj._id}`); + const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`); // This is "example" variable, change it to the userId that you might be using. const userId = fileObj.userId; @@ -1326,7 +1327,8 @@ Migrations.add('migrate-avatars-collectionFS-to-ostrioFiles', () => { // const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`); // NEW: Save file only with filename of ObjectID, not including filename. // Fixes https://github.com/wekan/wekan/issues/4416#issuecomment-1510517168 - const filePath = path.join(storagePath, `${fileObj._id}`); + //const filePath = path.join(storagePath, `${fileObj._id}`); + const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`); // This is "example" variable, change it to the userId that you might be using. const userId = fileObj.userId;