Skip to content

Commit 0ed510f

Browse files
author
Andrii Kasian
committed
MAGETWO-43755: [GITHUB] The commit «PCF: removing grouped price» from 2015-10-02 breaks Magento schema upgrading with the exception
1 parent 2aff5a6 commit 0ed510f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/code/Magento/Catalog/Setup/UpgradeData.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public function __construct(CategorySetupFactory $categorySetupFactory)
3939
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
4040
{
4141
$setup->startSetup();
42-
if ($context->getVersion() && version_compare($context->getVersion(), '2.0.1') < 0) {
43-
42+
if (version_compare($context->getVersion(), '2.0.1') < 0) {
4443
/** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */
4544
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
4645

@@ -53,9 +52,7 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
5352
'Images',
5453
'attribute_group_name'
5554
);
56-
if (isset($attributeGroup['attribute_group_name'])
57-
&& $attributeGroup['attribute_group_name'] == 'Images'
58-
) {
55+
if (isset($attributeGroup['attribute_group_name']) && $attributeGroup['attribute_group_name'] == 'Images') {
5956
// update General Group
6057
$categorySetup->updateAttributeGroup(
6158
$entityTypeId,
@@ -65,6 +62,11 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
6562
'Images and Videos'
6663
);
6764
}
65+
}
66+
67+
if ($context->getVersion()
68+
&& version_compare($context->getVersion(), '2.0.1') < 0
69+
) {
6870
$select = $setup->getConnection()->select()
6971
->from(
7072
$setup->getTable('catalog_product_entity_group_price'),

0 commit comments

Comments
 (0)