-- 이미 존재한다는 (insert 시) 에러메세지나 , 존재하지 않는다는 (delete 시) 에러메세지는 무시하셔도 무방합니다.

-- service - overview 삭제
-- user_permission2
DELETE FROM public.user_permission2 WHERE auth_resource_id = (SELECT id FROM auth_resource3 WHERE NAME = 'menu|Services|Overview') AND user_id = 'owner';

-- menu_meta
DELETE FROM public.menu_meta WHERE id = 22;

-- auth_resource2
DELETE FROM public.auth_resource2 WHERE name = 'Overview' AND parent_id = (select id from auth_resource2 where type='menu' and name='Services');

-- auth_resource3
DELETE FROM public.auth_resource3 WHERE name = 'menu|Services|Overview';


-- service - active transaction 추가
-- auth_resource3
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Services|Active Transaction', false, null);

-- menu_meta
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (26, 'Active Transaction', NULL, 5, 'overviewServiceJSPD', (select id from auth_resource3 where name='menu|Services|Active Transaction'), 2);