diff --git a/migration/20.03/migrateOutgoingAttachments.php b/migration/20.03/migrateOutgoingAttachments.php index a15cb93ce4e93e8d974469c62d62c22dca86764d..9643c585f6dcfe5454b8abe5600e1f2155c55f91 100644 --- a/migration/20.03/migrateOutgoingAttachments.php +++ b/migration/20.03/migrateOutgoingAttachments.php @@ -93,24 +93,6 @@ foreach ($customs as $custom) { 'version' => $attachmentInfo['relation'], 'fingerprint' => $convertedDocument[0]['fingerprint'] ]); - - $thumbnailDocument = \SrcCore\models\DatabaseModel::select([ - 'select' => ['docserver_id','path', 'filename', 'fingerprint'], - 'table' => ['adr_attachments'], - 'where' => ['res_id = ?', 'type = ?'], - 'data' => [$attachmentInfo['res_id'], 'TNL'], - ]); - if (!empty($thumbnailDocument)) { - AdrModel::createDocumentAdr([ - 'resId' => $attachmentInfo['res_id_master'], - 'type' => 'TNL', - 'docserverId' => $thumbnailDocument[0]['docserver_id'], - 'path' => $thumbnailDocument[0]['path'], - 'filename' => $thumbnailDocument[0]['filename'], - 'version' => $attachmentInfo['relation'], - 'fingerprint' => $thumbnailDocument[0]['fingerprint'] - ]); - } $attachmentToDelete[] = $attachmentInfo['res_id']; $customId = empty($custom) ? 'null' : $custom; @@ -129,23 +111,6 @@ foreach ($customs as $custom) { $attachmentVersion[0]['adrType'] = 'PDF'; $attachmentVersion[0]['relation'] = $attachmentVersion['relation']; addOutgoingMailSignedInAdr($attachmentVersion[0]); - $thumbnailDocument = \SrcCore\models\DatabaseModel::select([ - 'select' => ['docserver_id','path', 'filename', 'fingerprint'], - 'table' => ['adr_attachments'], - 'where' => ['res_id = ?', 'type = ?'], - 'data' => [$attachmentVersion['res_id'], 'TNL'], - ]); - if (!empty($thumbnailDocument)) { - AdrModel::createDocumentAdr([ - 'resId' => $attachmentInfo['res_id_master'], - 'type' => 'TNL', - 'docserverId' => $thumbnailDocument[0]['docserver_id'], - 'path' => $thumbnailDocument[0]['path'], - 'filename' => $thumbnailDocument[0]['filename'], - 'version' => $attachmentVersion['relation'], - 'fingerprint' => $thumbnailDocument[0]['fingerprint'] - ]); - } $attachmentToDelete[] = $attachmentVersion['res_id']; } }