@@GO@@
Update catalog_category_entity set 
children_count = children_count + 1
where entity_id = select a.parent_id from catalog_category_entity a where 
a.entity_id = <@KEY@>
@@GO@@
Update catalog_category_entity set 
path= concat(path,<@KEY@>)
where entity_id  <@KEY@>
@@GO@@
update catalog_category_entity set children_count = children_count + 1  where entity_id= '1' 
@@GO@@
INSERT INTO core_url_rewrite (
url_rewrite_id, 
store_id, 
id_path, 
request_path, 
target_path, 
is_system, 
options, 
description, 
category_id, 
product_id
) VALUES (
'', 
1, 
concat('category/', '<@KEY@>'), 
concat(REPLACE('<@SDESCRIPTION@>',' ','-'), '.html'), 
concat('catalog/category/view/id/', '<@KEY@>'), 
1, 
NULL, 
NULL, 
<@KEY@>, 
NULL
)
@@GO@@
INSERT INTO index_event (
event_id, 
type, 
entity, 
entity_pk, 
created_at, 
old_data, 
new_data
) values (
'',   
'save', 
'catalog_category', 
<@KEY@>,     
now(),
NULL, 
'a:6:{s:35:"cataloginventory_stock_match_result";b:0;s:34:"catalog_product_price_match_result";b:0;s:24:"catalog_url_match_result";b:1;s:33:"catalog_product_flat_match_result";b:0;s:37:"catalog_category_product_match_result";b:1;s:35:"catalogsearch_fulltext_match_result";b:1;}'
)
@@GO@@
Update index_process set started_at = now(), ended_at = now() where indexer_code = 'catalog_url';
@@GO@@
Update index_process set started_at = now(), ended_at = now() where indexer_code = 'catalog_category_product';
@@GO@@
Update index_process set started_at = now(), ended_at = now() where indexer_code = 'catalogsearch_fulltext';
@@GO@@