Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save platonische/c23470cfa74dfca96290f1594b9fd130 to your computer and use it in GitHub Desktop.

Select an option

Save platonische/c23470cfa74dfca96290f1594b9fd130 to your computer and use it in GitHub Desktop.
Magento 2 db data checking
DELETE FROM eav_attribute_option_value
WHERE value_id IN (
SELECT tmp.value_id from (
SELECT value_id
FROM eav_attribute_option_value
GROUP BY option_id, store_id
HAVING COUNT(*) > 1
) as tmp
);
SELECT eaov.value_id, eao.attribute_id, ea.attribute_code
FROM eav_attribute_option_value as eaov
LEFT JOIN eav_attribute_option as eao ON eaov.option_id = eao.option_id
LEFT JOIN eav_attribute as ea ON eao.attribute_id = ea.attribute_id
GROUP BY eaov.option_id, eaov.store_id
HAVING COUNT(*) > 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment