@@ -31,22 +31,32 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
3131 'FK_CAT_PRD_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID '
3232 );
3333
34- //Drop entity_type_id column for catalog product entities
35- // $connection->dropColumn($installer->getTable('catalog_product_entity'), 'entity_type_id');
36- // $connection->dropColumn($installer->getTable('catalog_product_entity_datetime'), 'entity_type_id');
37- // $connection->dropColumn($installer->getTable('catalog_product_entity_decimal'), 'entity_type_id');
38- // $connection->dropColumn($installer->getTable('catalog_product_entity_gallery'), 'entity_type_id');
39- // $connection->dropColumn($installer->getTable('catalog_product_entity_int'), 'entity_type_id');
40- // $connection->dropColumn($installer->getTable('catalog_product_entity_text'), 'entity_type_id');
41- // $connection->dropColumn($installer->getTable('catalog_product_entity_varchar'), 'entity_type_id');
42-
43- //Drop entity_type_id column for catalog category entities
44- // $connection->dropColumn($installer->getTable('catalog_category_entity'), 'entity_type_id');
45- // $connection->dropColumn($installer->getTable('catalog_category_entity_datetime'), 'entity_type_id');
46- // $connection->dropColumn($installer->getTable('catalog_category_entity_decimal'), 'entity_type_id');
47- // $connection->dropColumn($installer->getTable('catalog_category_entity_int'), 'entity_type_id');
48- // $connection->dropColumn($installer->getTable('catalog_category_entity_text'), 'entity_type_id');
49- // $connection->dropColumn($installer->getTable('catalog_category_entity_varchar'), 'entity_type_id');
34+ $ dropTablesColumn = [
35+ 'catalog_product_entity ' ,
36+ 'catalog_product_entity_datetime ' ,
37+ 'catalog_product_entity_decimal ' ,
38+ 'catalog_product_entity_gallery ' ,
39+ 'catalog_product_entity_int ' ,
40+ 'catalog_product_entity_text ' ,
41+ 'catalog_product_entity_varchar ' ,
42+ 'catalog_category_entity ' ,
43+ 'catalog_category_entity_datetime ' ,
44+ 'catalog_category_entity_decimal ' ,
45+ 'catalog_category_entity_int ' ,
46+ 'catalog_category_entity_text ' ,
47+ 'catalog_category_entity_varchar '
48+ ];
49+ foreach ($ dropTablesColumn as $ table ) {
50+ $ connection ->dropIndex (
51+ $ table ,
52+ $ installer ->getIdxName (
53+ $ table ,
54+ 'entity_type_id ' ,
55+ \Magento \Framework \DB \Adapter \AdapterInterface::INDEX_TYPE_INDEX
56+ )
57+ );
58+ $ connection ->dropColumn ($ installer ->getTable ($ table ), 'entity_type_id ' );
59+ }
5060
5161 $ installer ->endSetup ();
5262 }
0 commit comments