Skip to content

Instantly share code, notes, and snippets.

@Affenpilot
Created June 9, 2022 12:08
Show Gist options
  • Save Affenpilot/742e514ddeeee0b7d04ca66ddfc4982f to your computer and use it in GitHub Desktop.
Save Affenpilot/742e514ddeeee0b7d04ca66ddfc4982f to your computer and use it in GitHub Desktop.
fix duplicated entry in url_rewrite table
START TRANSACTION;
CREATE TABLE catalog_url_rewrite_product_category_temp SELECT DISTINCT * FROM catalog_url_rewrite_product_category;
ALTER TABLE catalog_url_rewrite_product_category RENAME catalog_url_rewrite_product_category_backup;
ALTER TABLE catalog_url_rewrite_product_category_temp RENAME catalog_url_rewrite_product_category;
DROP TABLE catalog_url_rewrite_product_category_backup;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment