Created
October 22, 2014 15:20
-
-
Save hughgrigg/69bb3702382a76bd79a4 to your computer and use it in GitHub Desktop.
Removing invalid rows from Magento eav_attribute_option and catalog_product_entity_int
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete option rows pointing to non-existent attributes | |
DELETE `option` | |
FROM `eav_attribute_option` AS `option` | |
LEFT JOIN `eav_attribute` | |
ON `eav_attribute`.`attribute_id` = `option`.`attribute_id` | |
WHERE `eav_attribute`.`attribute_id` IS NULL; | |
# Delete product attribute int rows pointing to non-existent attributes | |
DELETE `entity_int` | |
FROM `catalog_product_entity_int` AS `entity_int` | |
LEFT JOIN `eav_attribute` AS `attribute` | |
ON (`attribute`.`attribute_id` = `entity_int`.`attribute_id`) | |
WHERE `attribute`.`attribute_id` IS NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment