# 1.2.x 升级2.0.0 sql脚本 ```sql INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('5', '', 'Snis', 'icon-sni', 'views/gateway/sni/index', 'snis', 'y', 'menu', 'kongx', '7'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('5', '', 'Certificates', 'icon-certificate', 'views/gateway/certificate/index', 'certificate', 'y', 'menu', 'kongx', '8'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('53', 'consumer_add', '新增consumer', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('53', 'consumer_update', '更新consumer', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('53', 'consumer_delete', '删除consumer', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('60', 'certificate_view', '查看certificate', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('60', 'certificate_add', '新增certificate', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('60', 'certificate_update', '修改certificate', '', '', '', 'y', 'point', 'kongx', '999'); INSERT INTO `kongx_system_function` (`parent_id`, `code`, `name`, `menu_icon`, `visit_view`, `visit_path`, `use_yn`, `menu_type`, `application_code`, `sort_order`) VALUES ('60', 'certificate_delete', '删除certificate', '', '', '', 'y', 'point', 'kongx', '999'); insert into kongx_system_role_function(role_id,half_checked,function_id) select * from ( select '1' role_id,'n' half_checked,'-1' as function_id union all select '1' role_id,'n' half_checked,id as function_id from kongx_system_function ) a where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id); insert into kongx_system_role_function(role_id,half_checked,function_id) select * from ( select '2' role_id,'y' half_checked,'-1' as function_id union select '2' role_id,'y' half_checked,id as function_id from kongx_system_function where name in ('Gateway','Upstreams','Services','Routes','Plugins','Kong Shell','Consumers','Certificates','日志管理') union select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where code in ('service_view','upstream_view','route_view','plugin_view','consumer_view','certificate_view') union select '2' role_id,'n' half_checked,id as function_id from kongx_system_function where name='操作日志' ) a where not EXISTS (select * from kongx_system_role_function b where a.function_id=b.function_id and b.role_id=a.role_id); ```