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 (
<@WGROUPID@>,
'3',
'3',
<@WPARENTGROUP2ID@>,
now(),
now(),
'1/2/<@GRPARID@>/<@WPARENTGROUP2ID@>/<@WGROUPID@>',
<@WSORTNO@>, 
'3',
''
)
@@GO@@
Update catalog_category_entity set 
children_count = children_count + 1
where parent_id = <@WPARENTGROUP2ID@>
@@GO@@
update catalog_category_entity set children_count = children_count + 1  where entity_id= '1'
@@GO@@
INSERT INTO catalog_category_entity_datetime (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'', 
'3', 
'53', 
'<@PREFIX@>',
<@WGROUPID@>,     
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_datetime (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'', 
'3', 
'59',
'<@PREFIX@>',  
<@WGROUPID@>, 
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_datetime (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'', 
'3', 
'60',
'0',  
<@WGROUPID@>, 
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_decimal (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) VALUES( 
'', 
'3', 
'70', 
'<@PREFIX@>', 
<@WGROUPID@>, 
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'42', 
'<@PREFIX@>', 
<@WGROUPID@>,    
'1'
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'67', 
'<@PREFIX@>', 
<@WGROUPID@>,     
'1'
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'50', 
'<@PREFIX@>', 
<@WGROUPID@>,    
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'51', 
'<@PREFIX@>', 
<@WGROUPID@>,     
'0'
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'68', 
'<@PREFIX@>', 
<@WGROUPID@>,     
'0'
)
@@GO@@
INSERT INTO catalog_category_entity_int (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'69', 
'<@PREFIX@>', 
<@WGROUPID@>,     
'0'
)
@@GO@@
INSERT INTO catalog_category_entity_text (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'44', 
'<@PREFIX@>', 
<@WGROUPID@>,     
'<@SDESCRIPTION@>'
)
@@GO@@
INSERT INTO catalog_category_entity_text (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'47',  
'<@PREFIX@>', 
<@WGROUPID@>,     
'Meta Keywords'
)
@@GO@@
INSERT INTO catalog_category_entity_text (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'48',  
'<@PREFIX@>', 
<@WGROUPID@>,     
'Meta Description'
)
@@GO@@
INSERT INTO catalog_category_entity_text (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'62',  
'<@PREFIX@>', 
<@WGROUPID@>,     
''
)
@@GO@@
INSERT INTO catalog_category_entity_text (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'65',   
'<@PREFIX@>', 
<@WGROUPID@>,     
''
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'41', 
'0', 
<@WGROUPID@>,     
'<@SDESCRIPTION@>'
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'43', 
'0',  
<@WGROUPID@>,     
REPLACE('<@SDESCRIPTION@>',' ','-')
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'46',  
'0', 
<@WGROUPID@>,    
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'49', 
'0', 
<@WGROUPID@>,     
'PRODUCTS'
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'58', 
'0', 
<@WGROUPID@>,     
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'61', 
'0', 
<@WGROUPID@>,     
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'57', 
'0', 
<@WGROUPID@>,     
NULL
)
@@GO@@
INSERT INTO catalog_category_entity_varchar (
value_id, 
entity_type_id, 
attribute_id, 
store_id, 
entity_id, 
value
) values (
'',   
'3', 
'57', 
'1', 
<@WGROUPID@>,     
NULL
)
@@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/', '<@WGROUPID@>'), 
concat(REPLACE('<@SDESCRIPTION@>',' ','-'), '.html'), 
concat('catalog/category/view/id/', '<@WGROUPID@>'), 
1, 
NULL, 
NULL, 
<@WGROUPID@>, 
NULL
)
@@GO@@
INSERT INTO index_event (
event_id, 
type, 
entity, 
entity_pk, 
created_at, 
old_data, 
new_data
) values (
'',   
'save', 
'catalog_category', 
<@WGROUPID@>,     
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@@