ClearAttributes

GitHub - magesuite/clear-attributes

This module removes values left over from not existing EAV attributes. The script is executed during setup:upgrade.

Installation

This module is a part of MageSuite metapackage

Installation if meta package is not used:

composer require "creativestyle/magesuite-clear-attributes" ^1.0.0

Admin settings

There are no admin settings, the module is enabled by default.

Backend

The module has the possibility to print SQL queries which are executed during cleanup in the console: bin/magento cs:clear:attributes

DELETE FROM catalog_category_entity_datetime WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_category_entity_decimal WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_category_entity_int WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_category_entity_text WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_category_entity_varchar WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_datetime WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_decimal WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_gallery WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_int WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_media_gallery WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_text WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM catalog_product_entity_varchar WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);

Â