Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

https://github.com/magesuite/clear-attributes

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

Installation

Info

This module is a part of MageSuite metapackage

Installation if meta package is not used:

Code Block
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

Code Block
languagesql
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);