浏览代码

Added more descriptive times of attachment migrations and uploads.

Thanks to xet7 !

Related https://github.com/wekan/wekan/issues/4891
Lauri Ojansivu 2 年之前
父节点
当前提交
f11650ece1
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      models/attachments.js
  2. 2 1
      server/migrations.js

+ 1 - 0
models/attachments.js

@@ -91,6 +91,7 @@ Attachments = new FilesCollection({
     });
 
     Attachments.update({ _id: fileObj._id }, { $set: { "versions" : fileObj.versions } });
+    Attachments.update({ _id: fileObj.uploadedAtOstrio }, { $set: { "uploadedAtOstrio" : this._now() } });
 
     let storageDestination = fileObj.meta.copyStorage || STORAGE_NAME_GRIDFS;
     Meteor.defer(() => Meteor.call('validateAttachmentAndMoveToStorage', fileObj._id, storageDestination));

+ 2 - 1
server/migrations.js

@@ -1281,7 +1281,8 @@ Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => {
             cardId: fileObj.cardId,
             listId: fileObj.listId,
             swimlaneId: fileObj.swimlaneId,
-            uploadedAt: fileObj.uploadedAt,
+            uploadedBeforeMigration: fileObj.uploadedAt,
+            migrationTime: this.now(),
             copies: fileObj.copies,
             source: 'import'
           },