pranayaryal
6/28/2017 - 9:01 PM

query for selecting parent and children in inventory_categories

query for selecting parent and children in inventory_categories

select id,name,type,parent_id from inventory_categories where slug like '%electric-forklift%' and type=1 and dealer_subsite_id = 28;


#get for parent_id 2996(internal-combustion-forklifts-cushion-tire)
select * from inventory_categories where parent_id = 2996;


This returns 67 rows
select count(*) from inventory_categories where slug regexp('internal-combustion-forklifts-cushion-tire');

1. get the ids from this query
2. create inventory_categories named 'paper-roll-special' using the above as parent_ids
3. Create inventories using the ids of above

/etc/cron.daily/db_backup