From 42ede9421bb317dfa6b7c126a8554b2a594dbf8f Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Mon, 25 Nov 2019 18:00:38 +0100
Subject: [PATCH] FEAT #11691 TIME 0:10 migrate doc_date to modification_date

---
 migration/19.12/migrateVersionAttachments.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/migration/19.12/migrateVersionAttachments.php b/migration/19.12/migrateVersionAttachments.php
index da2a63a73dd..66cb65a71b9 100644
--- a/migration/19.12/migrateVersionAttachments.php
+++ b/migration/19.12/migrateVersionAttachments.php
@@ -41,6 +41,8 @@ foreach ($customs as $custom) {
         unset($attachmentInfo['res_id']);
         $attachmentInfo['origin_id'] = $attachmentInfo['attachment_id_master'];
         unset($attachmentInfo['attachment_id_master']);
+        $attachmentInfo['modification_date'] = $attachmentInfo['doc_date'];
+        unset($attachmentInfo['doc_date']);
         if (!empty($attachmentInfo['updated_by'])) {
             $userSerialId = \User\models\UserModel::getByLogin(['select' => ['id'], 'login' => $attachmentInfo['updated_by']]);
             $attachmentInfo['modified_by'] = $userSerialId['id'];
@@ -86,7 +88,7 @@ foreach ($customs as $custom) {
         migrateHistoryVersion(['oldResId' => $oldResId, 'newResId' => $newResId]);
         migrateEmailsVersion(['oldResId' => $oldResId, 'newResId' => $newResId]);
         migrateMessageExchangeVersion(['oldResId' => $oldResId, 'newResId' => $newResId]);
-        // migrateShippingVersion(['oldResId' => $oldResId, 'newResId' => $newResId]);
+        migrateShippingVersion(['oldResId' => $oldResId, 'newResId' => $newResId]);
         if (!in_array($attachmentInfo['status'], ['DEL', 'OBS', 'TMP'])) {
             migrateFullText(['newResId' => $newResId, 'customId' => $custom, 'userId' => $masterOwnerId]);
         }
-- 
GitLab