Skip to content

Commit 60be232

Browse files
author
Oleksandr Dubovyk
committed
Merge remote-tracking branch 'troll/MAGETWO-61503' into troll-bugfix-pr
2 parents 8e21d5a + 30d1cdd commit 60be232

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

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

Lines changed: 39 additions & 1 deletion
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
@@ -57,7 +58,13 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
5758
$setup->getConnection()->modifyColumn(
5859
$setup->getTable($table),
5960
'customer_group_id',
60-
['type' => 'integer', 'nullable' => false]
61+
[
62+
'type' => Table::TYPE_INTEGER,
63+
'nullable' => false,
64+
'unsigned' => true,
65+
'default' => '0',
66+
'comment' => 'Customer Group ID',
67+
]
6168
);
6269
}
6370
$this->recreateCatalogCategoryProductIndexTmpTable($setup);
@@ -80,6 +87,37 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
8087
'catalog_category_product_index_replica'
8188
);
8289
}
90+
91+
if (version_compare($context->getVersion(), '2.2.2', '<')) {
92+
$tables = [
93+
'catalog_product_entity_tier_price',
94+
'catalog_product_index_price_cfg_opt_agr_idx',
95+
'catalog_product_index_price_cfg_opt_agr_tmp',
96+
'catalog_product_index_price_cfg_opt_idx',
97+
'catalog_product_index_price_cfg_opt_tmp',
98+
'catalog_product_index_price_final_idx',
99+
'catalog_product_index_price_final_tmp',
100+
'catalog_product_index_price_idx',
101+
'catalog_product_index_price_opt_agr_idx',
102+
'catalog_product_index_price_opt_agr_tmp',
103+
'catalog_product_index_price_opt_idx',
104+
'catalog_product_index_price_opt_tmp',
105+
'catalog_product_index_price_tmp',
106+
];
107+
foreach ($tables as $table) {
108+
$setup->getConnection()->modifyColumn(
109+
$setup->getTable($table),
110+
'customer_group_id',
111+
[
112+
'type' => Table::TYPE_INTEGER,
113+
'nullable' => false,
114+
'unsigned' => true,
115+
'default' => '0',
116+
'comment' => 'Customer Group ID',
117+
]
118+
);
119+
}
120+
}
83121
$setup->endSetup();
84122
}
85123

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)