Skip to content

Instantly share code, notes, and snippets.

@pmirshad
Last active November 24, 2016 16:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pmirshad/3e68b1e8a823b364624f to your computer and use it in GitHub Desktop.
Save pmirshad/3e68b1e8a823b364624f to your computer and use it in GitHub Desktop.
Magento 1.9.0.1-2 Reset Categories
--
-- Magento 1.9.0.1-2 Reset Categories
--
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_category_anc_categs_index_idx`;
TRUNCATE TABLE `catalog_category_anc_categs_index_tmp`;
TRUNCATE TABLE `catalog_category_anc_products_index_idx`;
TRUNCATE TABLE `catalog_category_anc_products_index_tmp`;
TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_flat_store_1`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;
TRUNCATE TABLE `catalog_category_product_index_enbl_idx`;
TRUNCATE TABLE `catalog_category_product_index_enbl_tmp`;
TRUNCATE TABLE `catalog_category_product_index_idx`;
TRUNCATE TABLE `catalog_category_product_index_tmp`;
INSERT INTO `catalog_category_entity` (`entity_id`, `entity_type_id`, `attribute_set_id`, `parent_id`, `created_at`, `updated_at`, `path`, `position`, `level`, `children_count`) VALUES
(1, 3, 0, 0, '2014-10-25 09:38:43', '2014-10-25 09:38:43', '1', 0, 0, 1),
(2, 3, 3, 1, '2014-10-25 09:38:43', '2014-10-25 09:38:43', '1/2', 1, 1, 0);
INSERT INTO `catalog_category_entity_int` (`value_id`, `entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES
(1, 3, 67, 0, 1, 1),
(2, 3, 67, 1, 1, 1),
(3, 3, 42, 0, 2, 1),
(4, 3, 67, 0, 2, 1),
(5, 3, 42, 1, 2, 1),
(6, 3, 67, 1, 2, 1);
INSERT INTO `catalog_category_entity_text` (`value_id`, `entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES
(1, 3, 65, 0, 1, NULL),
(2, 3, 65, 1, 1, NULL),
(3, 3, 65, 0, 2, NULL),
(4, 3, 65, 1, 2, NULL);
INSERT INTO `catalog_category_entity_varchar` (`value_id`, `entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES
(1, 3, 41, 0, 1, 'Root Catalog'),
(2, 3, 41, 1, 1, 'Root Catalog'),
(3, 3, 43, 1, 1, 'root-catalog'),
(4, 3, 41, 0, 2, 'Default Category'),
(5, 3, 41, 1, 2, 'Default Category'),
(6, 3, 49, 1, 2, 'PRODUCTS'),
(7, 3, 43, 1, 2, 'default-category');
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment