Skip to content

Commit 72b6765

Browse files
author
Mykola Palamar
committed
MAGETWO-61503: Inconsistent catalog_product_entity_tier_price schema after upgrade
1 parent e513ab5 commit 72b6765

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\Setup\ModuleContextInterface;
1212
use Magento\Framework\Setup\SchemaSetupInterface;
1313
use Magento\Framework\Setup\UpgradeSchemaInterface;
14+
use Magento\Framework\DB\Ddl\Table;
1415

1516
/**
1617
* Upgrade the Catalog module DB scheme
@@ -80,6 +81,37 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
8081
'catalog_category_product_index_replica'
8182
);
8283
}
84+
85+
if (version_compare($context->getVersion(), '2.2.2', '<')) {
86+
$tables = [
87+
'catalog_product_entity_tier_price',
88+
'catalog_product_index_price_cfg_opt_agr_idx',
89+
'catalog_product_index_price_cfg_opt_agr_tmp',
90+
'catalog_product_index_price_cfg_opt_idx',
91+
'catalog_product_index_price_cfg_opt_tmp',
92+
'catalog_product_index_price_final_idx',
93+
'catalog_product_index_price_final_tmp',
94+
'catalog_product_index_price_idx',
95+
'catalog_product_index_price_opt_agr_idx',
96+
'catalog_product_index_price_opt_agr_tmp',
97+
'catalog_product_index_price_opt_idx',
98+
'catalog_product_index_price_opt_tmp',
99+
'catalog_product_index_price_tmp',
100+
];
101+
foreach ($tables as $table) {
102+
$setup->getConnection()->modifyColumn(
103+
$setup->getTable($table),
104+
'customer_group_id',
105+
[
106+
'type' => Table::TYPE_INTEGER,
107+
'nullable' => false,
108+
'unsigned' => true,
109+
'default' => '0',
110+
'comment' => 'Customer Group ID',
111+
]
112+
);
113+
}
114+
}
83115
$setup->endSetup();
84116
}
85117

app/code/Magento/Catalog/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Catalog" setup_version="2.2.1">
9+
<module name="Magento_Catalog" setup_version="2.2.2">
1010
<sequence>
1111
<module name="Magento_Eav"/>
1212
<module name="Magento_Cms"/>

0 commit comments

Comments
 (0)