DELETE FROM acm_group_role_menu WHERE client_portal_id = 142;

INSERT INTO acm_group_role_menu (`menus_id`, `client_portal_id`, `description`, `platform`, `status`,
`cid`, `created_by`, `updated_by`, `on_created`, `on_updated`)
SELECT am.id, 142, arm.description, arm.platform, arm.`status`, arm.cid, arm.created_by, arm.updated_by, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
FROM acm_group_role_menu as arm
INNER JOIN acm_menus am ON am.id = arm.menus_id
WHERE arm.client_portal_id = 149;

DELETE FROM acm_group_role_association WHERE group_role_id = 12;
INSERT INTO acm_group_role_association (`menu_id`, `group_role_id`,`del`,`vie`,`upd`,`rig`,`on_created`,`on_updated`,`component_name`,`file_name`,`description`,`status`)
SELECT am.id, 12, 0, 0, 0, 0,  CURRENT_TIMESTAMP, CURRENT_TIMESTAMP ,agra.component_name,agra.file_name,agra.description,agra.status
FROM acm_group_role_association as agra
INNER JOIN acm_menus am ON am.id = agra.menu_id
WHERE agra.group_role_id = 17;


UPDATE acm_group_role_association agra SET file_name = "performancemanagement/rewards/history" WHERE agra.menu_id = 177;
UPDATE acm_group_role_association agra SET file_name = "performancemanagement/promotions/history" WHERE agra.menu_id = 178;

UPDATE acm_group_role_menu agrm SET STATUS = 1 WHERE agrm.client_portal_id = 142;
UPDATE acm_group_role_menu agrm SET STATUS = 0 WHERE agrm.client_portal_id = 142 AND menus_id=3;
UPDATE acm_group_role_menu agrm SET STATUS = 0 WHERE agrm.client_portal_id = 142 AND menus_id=7;
/* disable roster plan*/
UPDATE acm_group_role_menu agrm SET STATUS = 0 WHERE agrm.menus_id = 205;
/* for access matrix */
UPDATE acm_group_role_menu SET STATUS = 0 WHERE (menus_id  = 344 OR menus_id  = 345 OR menus_id  = 346 OR menus_id  = 347 OR menus_id  = 348 OR menus_id  = 349) ;
/* for pm */
UPDATE acm_group_role_menu SET STATUS = 0 WHERE (menus_id  = 45 OR menus_id  = 46 OR menus_id  = 47 OR menus_id  = 48 OR menus_id  = 49 OR menus_id  = 51 OR menus_id  = 51 OR menus_id  = 388 OR menus_id  = 166 OR menus_id  = 167); 
