Skip to content

Commit 75803b4

Browse files
committed
ACP2E-1675: [Cloud] Deployment issue due to exceeded memory and large tables
1 parent 7a2437f commit 75803b4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/code/Magento/Catalog/Setup/Patch/Data/UpdateMultiselectAttributesBackendTypes.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
use Magento\Catalog\Model\Product;
1010
use Magento\Eav\Setup\EavSetup;
1111
use Magento\Eav\Setup\EavSetupFactory;
12+
use Magento\Framework\DB\Adapter\AdapterInterface;
1213
use Magento\Framework\DB\Query\Generator;
1314
use Magento\Framework\DB\Select;
1415
use Magento\Framework\DB\Sql\Expression;
1516
use Magento\Framework\Setup\ModuleDataSetupInterface;
1617
use Magento\Framework\Setup\Patch\DataPatchInterface;
18+
use Magento\Framework\Setup\Patch\NonTransactionableInterface;
1719

18-
class UpdateMultiselectAttributesBackendTypes implements DataPatchInterface
20+
class UpdateMultiselectAttributesBackendTypes implements DataPatchInterface, NonTransactionableInterface
1921
{
2022
private const BATCH_SIZE = 10000;
2123

@@ -115,7 +117,12 @@ public function apply()
115117
$selectForInsert->reset(Select::COLUMNS);
116118
$selectForInsert->columns($columnNames);
117119
$connection->query(
118-
$connection->insertFromSelect($selectForInsert, $textTable, $columnNames)
120+
$connection->insertFromSelect(
121+
$selectForInsert,
122+
$textTable,
123+
$columnNames,
124+
AdapterInterface::INSERT_ON_DUPLICATE
125+
)
119126
);
120127
$selectForDelete = clone $select;
121128
$selectForDelete->reset(Select::COLUMNS);

0 commit comments

Comments
 (0)