/*
 change.sql 说明
 1.数据库相关修改添加到对应的 change.sql 文件，无需调整其他 sql  文件
 2.sql 语句验证正确后再提交
*/

alter table portal_sys_identity alter column alias_ type varchar(64) using alias_::varchar(64);


drop index idx_sys_properties_alias;
create unique index idx_sys_properties_alias
   on portal_sys_properties (alias);

-- yujl 2021-12-03 增加外部系统授权人的姓名字段
ALTER TABLE PORTAL_BIZ_SYSTEM ADD COLUMN ROBOT_NAME_ varchar2 (64);

-- yujl 2021-12-03 增加外部系统管理员表
CREATE TABLE portal_biz_system_auth(
               ID_ VARCHAR(64),
               SYS_CODE_ VARCHAR(50),
               SYS_NAME_ VARCHAR(50),
               MANAGER_ID_ VARCHAR(255),
               MANAGER_NAME_ VARCHAR(255),
               CREATE_TIME_ timestamp,
               CREATE_BY_ VARCHAR(255),
               CREATE_ORG_ID_ VARCHAR(255),
               IS_DELE_ VARCHAR(10),
               UPDATE_TIME_ timestamp,
               UPDATE_BY_ VARCHAR(64),
               TENANT_ID_ VARCHAR(255)
);

COMMENT ON TABLE portal_biz_system_auth IS '外部系统管理员表';

-- yujl 2021-12-03 新增【外部系统消息日志】菜单
INSERT into portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, ROUTE_EXTEND_, TENANT_ID_) VALUES ('1467391005218881536', '5403008', '外部系统消息日志', 'externalSystemQueueLog', '', '', NULL, 7, '', '-1.1.3421053.5403008.1467391005218881536.', '', '{\"path\":\"\",\"component\":\"Layout\",\"redirect\":\"\",\"alwaysShow\":false,\"caseSensitive\":false,\"meta\":{\"title\":\"\"}}', '-1');

-- jason 2021-12-10 新增表单脚本js字段
alter table "form_history_record" add column("DIY_JS_" TEXT);
comment on column "form_history_record"."DIY_JS_" is '表单脚本js';

-- yujl 2021-12-10 门户设计-个人信息栏目更新显示岗位的字段属性
update portal_sys_column set template_html ='PGRpdj4KICA8ZWwtcm93IDpndXR0ZXI9IjIwIiBzdHlsZT0icGFkZGluZy10b3A6IDEwcHg7IHBhZGRpbmctYm90dG9tOiAxMHB4Ij4KICAgIDxlbC1jb2wgOnNwYW49IjEyIj4KICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IGxlZnQ7IHdpZHRoOiA2MHB4OyBoZWlnaHQ6IDYwcHg7IGJvcmRlci1yYWRpdXM6IDUwJSI+CiAgICAgICAgPGltZwogICAgICAgICAgICAgc3JjPSJodHRwczovL2Z1c3MxMC5lbGVtZWNkbi5jb20vZS81ZC80YTczMWE5MDU5NGE0YWY1NDRjMGMyNTk0MTE3MWpwZWcuanBlZyIKICAgICAgICAgICAgIHN0eWxlPSJ3aWR0aDogNjBweDsgaGVpZ2h0OiA2MHB4OyBiYWNrZ3JvdW5kOiByZ2JhKDI0NSwgMjQ1LCAyNDUsIDEpOyBib3JkZXItcmFkaXVzOiA1MCUiCiAgICAgICAgICAgICAvPgogICAgICA8L2Rpdj4KICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IGxlZnQ7IHBhZGRpbmctbGVmdDogOHB4Ij4KICAgICAgICA8c3BhbgogICAgICAgICAgICAgIHN0eWxlPSIKICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAyMHB4OwogICAgICAgICAgICAgICAgICAgICBmb250LWZhbWlseTogTWljcm9zb2Z0IFlhSGVpOwogICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNDAwOwogICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSg4NSwgODUsIDg1LCAxKTsKICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDMwcHg7CiAgICAgICAgICAgICAgICAgICAgICIKICAgICAgICAgICAgICA+CiAgICAgICAgICDmgqjlpb3vvIF7eyBkYXRhLnVzZXIgPyBkYXRhLnVzZXIuZnVsbG5hbWUgOiAnJyB9fe+8jOelneS9oOW8gOW/g+avj+S4gOWkqe+8gQogICAgICAgIDwvc3Bhbj4KICAgICAgICA8YnIgLz4KICAgICAgICA8c3BhbgogICAgICAgICAgICAgIHN0eWxlPSIKICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxMnB4OwogICAgICAgICAgICAgICAgICAgICBmb250LWZhbWlseTogTWljcm9zb2Z0IFlhSGVpOwogICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNDAwOwogICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSgxNDUsIDE0NSwgMTQ1LCAxKTsKICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDMwcHg7CiAgICAgICAgICAgICAgICAgICAgICIKICAgICAgICAgICAgICA+CiAgICAgICAgICB7eyBkYXRhLmN1clBvc3R9fQogICAgICAgIDwvc3Bhbj4KICAgICAgPC9kaXY+CiAgICA8L2VsLWNvbD4KICAgIDxlbC1jb2wgOnNwYW49IjMiIHN0eWxlPSJwYWRkaW5nLXRvcDogNXB4Ij4KICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IGxlZnQiIEBjbGljaz0iaGFuZGxlUm93Q2xpY2soJy9tYXR0ZXIvbXlUYXNrP3RhYkFjdGl2ZU5hbWU9dG9kbycpIj4KICAgICAgICA8ZGl2CiAgICAgICAgICAgICBzdHlsZT0iZmxvYXQ6IGxlZnQ7IHdpZHRoOiA0MnB4OyBoZWlnaHQ6IDQycHg7IGJhY2tncm91bmQ6IHJnYmEoMTA0LCAxOTUsIDI1MywgMSk7IGJvcmRlci1yYWRpdXM6IDIxcHgiCiAgICAgICAgICAgICA+CiAgICAgICAgICA8c3BhbiBjbGFzcz0iaWNvbi10b2RvIiBzdHlsZT0iZm9udC1zaXplOiAyOHB4OyBwYWRkaW5nOiA4cHg7IGNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSkiPjwvc3Bhbj4KICAgICAgICA8L2Rpdj4KICAgICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogbGVmdDsgcGFkZGluZy1sZWZ0OiA4cHgiPgogICAgICAgICAgPGRpdiBzdHlsZT0iaGVpZ2h0OiAxOHB4Ij4KICAgICAgICAgICAgPHNwYW4KICAgICAgICAgICAgICAgICAgc3R5bGU9IgogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1mYW1pbHk6IE1pY3Jvc29mdCBZYUhlaTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSgyOCwgMjgsIDI4LCAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgIgogICAgICAgICAgICAgICAgICA+CiAgICAgICAgICAgICAge3sgZGF0YS5teVRha3MgPyBkYXRhLm15VGFrcy5kYXRhVGV4dCA6ICcnIH19CiAgICAgICAgICAgIDwvc3Bhbj4KICAgICAgICAgIDwvZGl2PgogICAgICAgICAgPGRpdj4KICAgICAgICAgICAgPHNwYW4KICAgICAgICAgICAgICAgICAgc3R5bGU9IgogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxMnB4OwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1mYW1pbHk6IE1pY3Jvc29mdCBZYUhlaTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSgxNDUsIDE0NSwgMTQ1LCAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgIgogICAgICAgICAgICAgICAgICA+CiAgICAgICAgICAgICAg5b6F5Yqe5pWw6YePCiAgICAgICAgICAgIDwvc3Bhbj4KICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgICA8L2Rpdj4KICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IHJpZ2h0Ij4KICAgICAgICA8c3BhbiBjbGFzcz0iZWwtZGl2aWRlciBlbC1kaXZpZGVyLS12ZXJ0aWNhbCIgc3R5bGU9ImZvbnQtc2l6ZTogNDBweCI+PC9zcGFuPgogICAgICA8L2Rpdj4KICAgIDwvZWwtY29sPgogICAgPGVsLWNvbCA6c3Bhbj0iMyIgc3R5bGU9InBhZGRpbmctdG9wOiA1cHgiPgogICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogbGVmdCIgQGNsaWNrPSJoYW5kbGVSb3dDbGljaygnL21hdHRlci9teVRhc2s/dGFiQWN0aXZlTmFtZT1kb25lJykiPgogICAgICAgIDxkaXYKICAgICAgICAgICAgIHN0eWxlPSJmbG9hdDogbGVmdDsgd2lkdGg6IDQycHg7IGhlaWdodDogNDJweDsgYmFja2dyb3VuZDogcmdiYSgxMTcsIDE3MSwgMjQ0LCAxKTsgYm9yZGVyLXJhZGl1czogMjFweCIKICAgICAgICAgICAgID4KICAgICAgICAgIDxzcGFuIGNsYXNzPSJpY29uLXlpYmFuIiBzdHlsZT0iZm9udC1zaXplOiAyOHB4OyBwYWRkaW5nOiA4cHg7IGNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSkiPjwvc3Bhbj4KICAgICAgICA8L2Rpdj4KICAgICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogbGVmdDsgcGFkZGluZy1sZWZ0OiA4cHgiPgogICAgICAgICAgPGRpdiBzdHlsZT0iaGVpZ2h0OiAxOHB4Ij4KICAgICAgICAgICAgPHNwYW4KICAgICAgICAgICAgICAgICAgc3R5bGU9IgogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1mYW1pbHk6IE1pY3Jvc29mdCBZYUhlaTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSgyOCwgMjgsIDI4LCAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgIgogICAgICAgICAgICAgICAgICA+CiAgICAgICAgICAgICAge3sgZGF0YS5teUFscmVhZHkgPyBkYXRhLm15QWxyZWFkeS5kYXRhVGV4dCA6ICcnIH19CiAgICAgICAgICAgIDwvc3Bhbj4KICAgICAgICAgIDwvZGl2PgogICAgICAgICAgPGRpdj4KICAgICAgICAgICAgPHNwYW4KICAgICAgICAgICAgICAgICAgc3R5bGU9IgogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxMnB4OwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1mYW1pbHk6IE1pY3Jvc29mdCBZYUhlaTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA0MDA7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmdiYSgxNDUsIDE0NSwgMTQ1LCAxKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgIgogICAgICAgICAgICAgICAgICA+CiAgICAgICAgICAgICAg5bey5Yqe5pWw6YePCiAgICAgICAgICAgIDwvc3Bhbj4KICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgICA8L2Rpdj4KICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IHJpZ2h0Ij4KICAgICAgICA8c3BhbiBjbGFzcz0iZWwtZGl2aWRlciBlbC1kaXZpZGVyLS12ZXJ0aWNhbCIgc3R5bGU9ImZvbnQtc2l6ZTogNDBweCI+PC9zcGFuPgogICAgICA8L2Rpdj4KICAgIDwvZWwtY29sPgogICAgPGVsLWNvbCA6c3Bhbj0iMyIgc3R5bGU9InBhZGRpbmctdG9wOiA1cHgiPgogICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogbGVmdCIgQGNsaWNrPSJoYW5kbGVSb3dDbGljaygnL21hdHRlci9hcHBseScpIj4KICAgICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogbGVmdDsgd2lkdGg6IDQycHg7IGhlaWdodDogNDJweDsgYmFja2dyb3VuZDogcmdiYSg5NywgMTk1LCAyMjksIDEpOyBib3JkZXItcmFkaXVzOiAyMXB4Ij4KICAgICAgICAgIDxzcGFuIGNsYXNzPSJpY29uLXJlcWV1c3Qtc3RhcnQiIHN0eWxlPSJmb250LXNpemU6IDI4cHg7IHBhZGRpbmc6IDhweDsgY29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KSI+PC9zcGFuPgogICAgICAgIDwvZGl2PgogICAgICAgIDxkaXYgc3R5bGU9ImZsb2F0OiBsZWZ0OyBwYWRkaW5nLWxlZnQ6IDhweCI+CiAgICAgICAgICA8ZGl2IHN0eWxlPSJoZWlnaHQ6IDE4cHgiPgogICAgICAgICAgICA8c3BhbgogICAgICAgICAgICAgICAgICBzdHlsZT0iCiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LWZhbWlseTogTWljcm9zb2Z0IFlhSGVpOwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC13ZWlnaHQ6IDQwMDsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiByZ2JhKDI4LCAyOCwgMjgsIDEpOwogICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDMwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAiCiAgICAgICAgICAgICAgICAgID4KICAgICAgICAgICAgICB7eyBkYXRhLm15UmVxdWVzdCA/IGRhdGEubXlSZXF1ZXN0LmRhdGFUZXh0IDogJycgfX0KICAgICAgICAgICAgPC9zcGFuPgogICAgICAgICAgPC9kaXY+CiAgICAgICAgICA8ZGl2PgogICAgICAgICAgICA8c3BhbgogICAgICAgICAgICAgICAgICBzdHlsZT0iCiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDEycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LWZhbWlseTogTWljcm9zb2Z0IFlhSGVpOwogICAgICAgICAgICAgICAgICAgICAgICAgZm9udC13ZWlnaHQ6IDQwMDsKICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiByZ2JhKDE0NSwgMTQ1LCAxNDUsIDEpOwogICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDMwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAiCiAgICAgICAgICAgICAgICAgID4KICAgICAgICAgICAgICDmiJHnmoTor7fmsYIKICAgICAgICAgICAgPC9zcGFuPgogICAgICAgICAgPC9kaXY+CiAgICAgICAgPC9kaXY+CiAgICAgIDwvZGl2PgogICAgICA8ZGl2IHN0eWxlPSJmbG9hdDogcmlnaHQiPgogICAgICAgIDxzcGFuIGNsYXNzPSJlbC1kaXZpZGVyIGVsLWRpdmlkZXItLXZlcnRpY2FsIiBzdHlsZT0iZm9udC1zaXplOiA0MHB4Ij48L3NwYW4+CiAgICAgIDwvZGl2PgogICAgPC9lbC1jb2w+CiAgICA8ZWwtY29sIDpzcGFuPSIzIiBzdHlsZT0icGFkZGluZy10b3A6IDVweCI+CiAgICAgIDxkaXYgc3R5bGU9ImZsb2F0OiBsZWZ0IiBAY2xpY2s9ImhhbmRsZVJvd0NsaWNrKCcvbWF0dGVyL215VGFzaz90YWJBY3RpdmVOYW1lPW15RGVsZWdhdGUnKSI+CiAgICAgICAgPGRpdgogICAgICAgICAgICAgc3R5bGU9ImZsb2F0OiBsZWZ0OyB3aWR0aDogNDJweDsgaGVpZ2h0OiA0MnB4OyBiYWNrZ3JvdW5kOiByZ2JhKDEyMCwgMjE2LCAyMTcsIDEpOyBib3JkZXItcmFkaXVzOiAyMXB4IgogICAgICAgICAgICAgPgogICAgICAgICAgPHNwYW4gY2xhc3M9Imljb24tdG9kbyIgc3R5bGU9ImZvbnQtc2l6ZTogMjhweDsgcGFkZGluZzogOHB4OyBjb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpIj48L3NwYW4+CiAgICAgICAgPC9kaXY+CiAgICAgICAgPGRpdiBzdHlsZT0iZmxvYXQ6IGxlZnQ7IHBhZGRpbmctbGVmdDogOHB4Ij4KICAgICAgICAgIDxkaXYgc3R5bGU9ImhlaWdodDogMThweCI+CiAgICAgICAgICAgIDxzcGFuCiAgICAgICAgICAgICAgICAgIHN0eWxlPSIKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBNaWNyb3NvZnQgWWFIZWk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNDAwOwogICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHJnYmEoMjgsIDI4LCAyOCwgMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lLWhlaWdodDogMzBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICIKICAgICAgICAgICAgICAgICAgPgogICAgICAgICAgICAgIHt7IGRhdGEubXlBY2NvcmRpbmdNYXR0ZXJzID8gZGF0YS5teUFjY29yZGluZ01hdHRlcnMuZGF0YVRleHQgOiAnJyB9fQogICAgICAgICAgICA8L3NwYW4+CiAgICAgICAgICA8L2Rpdj4KICAgICAgICAgIDxkaXY+CiAgICAgICAgICAgIDxzcGFuCiAgICAgICAgICAgICAgICAgIHN0eWxlPSIKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTJweDsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBNaWNyb3NvZnQgWWFIZWk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNDAwOwogICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHJnYmEoMTQ1LCAxNDUsIDE0NSwgMSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lLWhlaWdodDogMzBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICIKICAgICAgICAgICAgICAgICAgPgogICAgICAgICAgICAgIOi9rOWKnuaVsOmHjwogICAgICAgICAgICA8L3NwYW4+CiAgICAgICAgICA8L2Rpdj4KICAgICAgICA8L2Rpdj4KICAgICAgPC9kaXY+CiAgICAgIDxkaXYgc3R5bGU9ImZsb2F0OiByaWdodCI+CiAgICAgICAgPHNwYW4gY2xhc3M9ImVsLWRpdmlkZXIgZWwtZGl2aWRlci0tdmVydGljYWwiIHN0eWxlPSJmb250LXNpemU6IDQwcHgiPjwvc3Bhbj4KICAgICAgPC9kaXY+CiAgICA8L2VsLWNvbD4KICA8L2VsLXJvdz4KPC9kaXY+'
where id='1267766070928871424';

-- yujl 2021-12-18 增加外部系统管理员唯一索引
CREATE UNIQUE INDEX uni_auth ON portal_biz_system_auth (sys_code_,manager_id_);

-- zhqa 2022-1-20 流程图表添加别名字段 
alter table bpm_report_list
	add ALIAS_ varchar(64);
comment on column bpm_report_list.ALIAS_ is '别名';

--oyhj 2022-1-11增加通过下属管理获取当前用户的上级的人员脚本
INSERT INTO BPM_MULTI_SCRIPT(ID_, ALIAS_NAME_, ALIAS_DESC_, CLASS_NAME_, CLASS_INS_NAME_, METHOD_NAME_, METHOD_DESC_, RETURN_TYPE_, ARGUMENT_, ENABLE_, TYPE_, TENANT_ID_) VALUES ('22', NULL, NULL, 'com.hotent.runtime.script.OrgScript', 'orgScript', 'getMasterFromUnder', '通过下属管理获取当前用户的上级', 'java.util.Set', '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"维度id或编码\",\"multiSelect\":false,\"paraCt\":\"base:dem-selector\",\"paraCtBindKey\":\"id\",\"paraCtBindName\":\"id\"}]', 1, 2, '-1');


--oyhj2022-01-24 新增在线用户管理菜单。目录：用户管理-在线用户
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1376480241760997376', '3441027', '在线用户', 'onlineUserManager', '', '', NULL, 4, '', '-1.1.3441009.3441027.1376480241760997376.', '', '-1');

-- oyhj 2021-01-26 关系矩阵添加搜索条件字段标识 
ALTER TABLE uc_matrix_col_def
    ADD COLUMN SEARCH_FIELD_ varchar(50) null; 
    COMMENT ON column uc_matrix_col_def.SEARCH_FIELD_ IS '是否作为搜索条件';                                                                                                                                              


-- oyhj 2021-02-9 流程自动发起配置表添加定时任务关联key 
ALTER TABLE bpm_auto_start_conf
    ADD COLUMN trigger_name_ varchar(100) NULL;
    COMMENT ON column bpm_auto_start_conf.trigger_name_ is '触发器key';

-- yujl 2022-02-09 弹窗提醒字段名称改为name_
ALTER TABLE portal_sys_popup RENAME name TO name_;

-- jjx 2022-02-18 新增内部消息菜单地址
INSERT INTO portal_sys_menu VALUES ('1494487013470261248', '1441341228585766912', '消息中心', 'xxzx', '', '', NULL, 1, '', '-1.3.1441341228585766912.1494487013470261248.', '', '-1', '{"path":"message","component":"@/views/personal/message","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":"消息中心","isChildren":true}}');

-- oyhj 2022-01-24 新增在线用户管理菜单。目录：用户管理-在线用户
INSERT INTO portal_sys_menu ("id_","parent_id_","name_","alias_","active_tab_","menu_icon_","opened_","sn_","tabs_style_","path_","href_","tenant_id_","route_extend_") VALUES ('1485448086022848512','3441027','在线用户','onlineUserManager',NULL,NULL,NULL,4,NULL,'-1.1.3441009.3441027.1485448086022848512.',NULL,'-1','{"path":"","component":"Layout","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":""}}');

-- oyhj 2022-2-21 新增流程发起人账号属性 
ALTER TABLE bpm_pro_inst
ADD COLUMN CREATE_ACCOUNT_ varchar(64) null;
COMMENT ON column bpm_pro_inst.CREATE_ACCOUNT_ is '流程发起人账号';

-- 2022-02-21 chenzm 新增扩展jar相关的菜单
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1351410819870625792', '4291768', '已发布脚本', 'extendClassManager', '', '', 1, 6, '', '-1.1.3641025.4291768.1351410819870625792.', '', '-1');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1351409335724544000', '4291768', '扩展Jar包管理', 'extendJarManager', '', '', 1, 5, '', '-1.1.3641025.4291768.1351409335724544000.', '', '-1');

-- 2022-02-21 chenzm  新增扩展jar包管理表
CREATE TABLE bpm_extend_class(
    ID_ VARCHAR(64) NOT NULL,
    JAR_ID_ VARCHAR(64),
    SIMPLE_NAME_ VARCHAR(255),
    PATH_ VARCHAR(500),
    DESC_ VARCHAR(255),
    MD5_ VARCHAR(255),
    TYPE_ VARCHAR(1),
    PRIMARY KEY (ID_)
);

COMMENT ON TABLE bpm_extend_class IS '已发布扩展脚本管理表';
COMMENT ON COLUMN bpm_extend_class.JAR_ID_ IS '所属jar包id';
COMMENT ON COLUMN bpm_extend_class.SIMPLE_NAME_ IS '类名首字母小写;即beanId';
COMMENT ON COLUMN bpm_extend_class.PATH_ IS '类名全路径';
COMMENT ON COLUMN bpm_extend_class.DESC_ IS '类描述';
COMMENT ON COLUMN bpm_extend_class.MD5_ IS 'MD5版本号';
COMMENT ON COLUMN bpm_extend_class.TYPE_ IS '脚本类型1：条件脚本;2：人员脚本';

-- 2022-02-21 chenzm  新增已发布扩展脚本管理表
CREATE TABLE bpm_extend_jar(
    ID_ VARCHAR(64) NOT NULL,
    NAME_ VARCHAR(255),
    DESC_ VARCHAR(255),
    JAR_FILE_ VARCHAR(2000),
    JAR_BYTES_ BYTEA,
    CREATE_BY_ VARCHAR(255),
    CREATE_NAME_ VARCHAR(255),
    UPDATE_BY_ VARCHAR(255),
    UPDATE_NAME_ VARCHAR(255),
    CREATE_TIME_ DATE,
    UPDATE_TIME_ DATE,
    SIZE_ INT,
    STATUS_ INT,
    PRIMARY KEY (ID_)
);

COMMENT ON TABLE bpm_extend_jar IS '扩展jar包管理表';
COMMENT ON COLUMN bpm_extend_jar.NAME_ IS 'jar包名称';
COMMENT ON COLUMN bpm_extend_jar.DESC_ IS 'jar包描述';
COMMENT ON COLUMN bpm_extend_jar.JAR_FILE_ IS 'jar包的附件路径';
COMMENT ON COLUMN bpm_extend_jar.JAR_BYTES_ IS 'jar包的二进制数据';
COMMENT ON COLUMN bpm_extend_jar.CREATE_BY_ IS '上传人id';
COMMENT ON COLUMN bpm_extend_jar.CREATE_NAME_ IS '上传人姓名';
COMMENT ON COLUMN bpm_extend_jar.UPDATE_BY_ IS '发布人id';
COMMENT ON COLUMN bpm_extend_jar.UPDATE_NAME_ IS '发布人姓名';
COMMENT ON COLUMN bpm_extend_jar.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN bpm_extend_jar.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN bpm_extend_jar.SIZE_ IS 'jar包大小;kb)';
COMMENT ON COLUMN bpm_extend_jar.STATUS_ IS 'jar包状态。1：未发布;2：已发布';

-- 2022-02-25 oyhj  新增流程实例彻底删除日志记录表
CREATE TABLE BPM_INST_DELETE_LOG (
	ID_ VARCHAR2(64) DEFAULT NULL,
	FULLNAME_ VARCHAR2(255) DEFAULT NULL,
	ACCOUNT_ VARCHAR2(255) DEFAULT NULL,
	DELETE_TIME_ TIMESTAMP(0) DEFAULT NULL,
	INST_SUBJECT_ VARCHAR2(128) DEFAULT NULL,
	CONTENT_ VARCHAR2(255) DEFAULT NULL
);

COMMENT ON TABLE BPM_INST_DELETE_LOG IS '流程实例删除日志';

COMMENT ON COLUMN BPM_INST_DELETE_LOG.FULLNAME_ IS '操作人姓名';

COMMENT ON COLUMN BPM_INST_DELETE_LOG.ACCOUNT_ IS '操作人账号';

COMMENT ON COLUMN BPM_INST_DELETE_LOG.DELETE_TIME_ IS '删除时间';

COMMENT ON COLUMN BPM_INST_DELETE_LOG.INST_SUBJECT_ IS '删除流程实例对象';

COMMENT ON COLUMN BPM_INST_DELETE_LOG.CONTENT_ IS '删除事由';



-- 2022-03-01 oyhj 添加菜单默认图标
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-design'
WHERE 'ID_' = '3441002';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-integrate'
WHERE 'ID_' = '1437982148582154240';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-system'
WHERE 'ID_' = '3421053';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-user1'
WHERE 'ID_' = '3441009';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-process'
WHERE 'ID_' = '1441339605377536000';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-process'
WHERE 'ID_' = '3641025';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-application1'
WHERE 'ID_' = '1254651824338767872';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-application1'
WHERE 'ID_' = '1441341831483412480';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-user1'
WHERE 'ID_' = '1441341228585766912';
UPDATE "PORTAL_SYS_MENU" SET "MENU_ICON_" = 'icon-aside-home'
WHERE 'ID_' = '1441359555827781632';


-- 2022-03-02 oyhj 去除系统属性 超时时间sql
DELETE FROM portal_sys_properties WHERE ALIAS='overTime';

-- 2022-03-03 zengst 一般用户添加默认菜单的权限
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092684890112', 'ybyh', 'matter', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092705861632', 'ybyh', 'personal', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092705861633', 'ybyh', 'appCenter1', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092705861634', 'ybyh', 'new', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092705861635', 'ybyh', 'myTask', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092710055936', 'ybyh', 'apply', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092710055937', 'ybyh', 'homePage', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092714250240', 'ybyh', 'Index', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092714250241', 'ybyh', 'setting', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092718444544', 'ybyh', 'mail', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092718444545', 'ybyh', 'appCenter2', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092718444546', 'ybyh', 'personalCenter', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092718444547', 'ybyh', 'approvalForm', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092718444548', 'ybyh', 'circulateMatter', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092722638848', 'ybyh', 'xxzx', null, null, '-1');
INSERT INTO portal_sys_role_auth (ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1499226092722638849', 'ybyh', 'startProcess', null, null, '-1');


-- 2022-03-02 oyhj 新增流程实例回收站菜单
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1497089603655909376', '4171077', '实例回收站', 'instanceRecovery', '', '', NULL, 4, '', '-1.1.3641025.4171077.1497089603655909376.', '', '-1', '{"path":"","component":"Layout","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":""}}');


-- 2022-03-15 oyhj 添加首页布局标题名
UPDATE "PORTAL_SYS_MENU" SET "ROUTE_EXTEND_" = '{\"meta\":{\"title\":\"首页\"},\"component\":\"Layout\",\"redirect\":\"index\",\"path\":\"/\"}'
WHERE 'ID_' = '1441359555827781632';


-- 2022-03-19 oyhj 修改索引
CREATE INDEX "IDX_PORTAL_SYS_COLUMNNULL577" ON portal_sys_column (ALIAS, TENANT_ID_);
