/*
 change.sql 说明
 1.数据库相关修改添加到对应的 change.sql 文件，无需调整其他 sql  文件
 2.sql 语句验证正确后再提交
*/
-- 2023-07-11 wanghb 数据列表和数据视图表，新增一个字段   
ALTER TABLE `form_query_sqldef` 
ADD COLUMN `create_by_` varchar(64) NULL COMMENT '创建人id' ,
ADD COLUMN `create_time_` datetime NULL COMMENT '创建时间' ,
ADD COLUMN `create_org_id_` varchar(64) NULL COMMENT '创建人组织id',
ADD COLUMN `update_by_` varchar(64) NULL COMMENT '更新人id',
ADD COLUMN `update_time_` datetime NULL COMMENT '更新时间';

-- 2023-07-11 yijj 增加自定义对图表数据类型和关联查询别名字段
ALTER TABLE `form_custom_chart`
    ADD COLUMN `type_` smallint NULL COMMENT '数据类型 1-数据源，2-关联查询' AFTER `CREATE_ORG_ID_`,
ADD COLUMN `custom_query_alias_` varchar(64) NULL COMMENT '关联查询别名' AFTER `type_`;

-- 2023-07-19 yijj 增加我的应用表
CREATE TABLE `portal_sys_user_app` (
    `ID_` varchar(64) NOT NULL,
    `TYPE_` varchar(10) DEFAULT NULL COMMENT '类型：pc ，mobile',
    `APP_ALIAS_` varchar(255) DEFAULT NULL COMMENT 'app别名',
    `ACCOUNT_` varchar(255) DEFAULT NULL COMMENT '用户account',
    `TENANT_ID_` varchar(64) DEFAULT NULL,
    PRIMARY KEY (`ID_`)
) COMMENT='我的应用表';

-- 2023-07-24 jjx 增加流程信息国际化资源
INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1683423659722665984', 'zh-TW', 'flowButton.ProcessInfo', '流程信息', NULL, '1', '', NULL, NULL, '-1');

INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1683423659747831808', 'zh-CN', 'flowButton.ProcessInfo', '流程信息', NULL, '1', '', NULL, NULL, '-1');

INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1683423659986907136', 'en', 'flowButton.ProcessInfo', 'Process Information', NULL, '1', '', NULL, NULL, '-1');

-- 2023-07-26 yijj 增加打开方式
ALTER TABLE `portal_news_notice_`
    ADD COLUMN `OPEN_TYPE_` varchar(10) NULL COMMENT '打开方式' AFTER `PUBLISH_TIME_`;


-- 2023-07-26 qiuxd 添加应用说明
ALTER TABLE `portal_sys_app` ADD COLUMN `FILE_INFO_` varchar(1000) NULL COMMENT '应用说明';


-- 集成中心企微钉钉增加PC端地址及PC端菜单URL update by 欧阳高龙 2023-07-27
ALTER TABLE `portal_sys_external_unite`
ADD COLUMN `PC_BASE_URL_` varchar(255) DEFAULT NULL COMMENT '本系统PC端地址' AFTER `BASE_URL_`;
ALTER TABLE `portal_sys_external_unite`
ADD COLUMN `PC_MENU_URL_` varchar(1000) DEFAULT NULL COMMENT 'PC端菜单url' AFTER `MENU_URL_`;

-- 2023-07-31 qiuxd 添加应用菜单权限表
CREATE TABLE `portal_sys_app_auth_menu` (
    `ID_` varchar(64) NOT NULL,
    `APP_ID_` varchar(64) DEFAULT NULL COMMENT '应用ID',
    `ROLE_ALIAS_` varchar(64) DEFAULT NULL COMMENT '角色别名',
    `MENU_ALIAS_` varchar(64) DEFAULT NULL COMMENT '菜单别名',
    `AUTH_TYPE_` varchar(32) DEFAULT NULL COMMENT '权限类型，增删查改等',
    `TENANT_ID_` varchar(64) DEFAULT NULL,
    PRIMARY KEY (`ID_`) USING BTREE,
    KEY `IDX_AUTHUSER_AUTHID` (`ROLE_ALIAS_`) USING BTREE,
    KEY `IDX_MENU_ID_` (`MENU_ALIAS_`) USING BTREE
) COMMENT='应用菜单权限表';

-- 2023-08-01 wanghb 表单资源授权对象表，新增授权对象类型字段
ALTER TABLE `form_authorize_act` ADD COLUMN `MODEL_TYPE_` varchar(255) NULL COMMENT '授权对象类型' ;

-- 2023-08-03 liangjc 人工催办表被催办人字段长度补充
ALTER TABLE bpm_task_urgent MODIFY APPOINTEE_ID_ text DEFAULT NULL COMMENT '被催办人ID';
ALTER TABLE bpm_task_urgent MODIFY APPOINTEE_ text DEFAULT NULL COMMENT '被催办人';

-- 2023-08-04 yijj 增加移动端扩展配置json
ALTER TABLE `form_data_template`
    ADD COLUMN `MOBILE_OTHER_JSON_` longtext NULL COMMENT '移动端扩展配置json' AFTER `INNER_BTN_CONFIG_`;
	
-- 2023-08-08 jjx 增加传阅事项国际化配置	
INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1688794655438794752', 'zh-TW', 'myReceived.circulator', '傳閲人', null, null, '', NULL, NULL, '-1');
INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1688794655455571968', 'zh-CN', 'myReceived.circulator', '传阅人', null,null, '', NULL, NULL, '-1');
INSERT INTO `portal_i18n_message`(`ID_`, `TYPE_`, `KEY_`, `VALUE_`, `CREATE_TIME_`, `CREATE_BY_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `TENANT_ID_`) VALUES ('1688794655480737792', 'en', 'myReceived.circulator', 'circulator',null, null, '', NULL, NULL, '-1');

-- 2023-08-09 liangjc 对话框增加 树形数据模式	字段
alter table form_custom_dialog add column TREE_DATA_MODE_ smallint DEFAULT NULL COMMENT '树形数据模式  0-默认方式，加载全部数据； 1-允许选择父级；2-不允许选择父级' after STYLE_;

-- 2023-08-22 liangjc 我的应用表增加栏目别名字段
ALTER TABLE `portal_sys_user_app` ADD COLUMN `COLUMN_ALIAS_` varchar(100) NULL COMMENT '栏目别名' AFTER `ACCOUNT_`;

-- 2023-08-25 JJX 修改系统属性中的待办列表配置
UPDATE `portal_sys_properties` SET  `VALUE` = 'dPM0jUDDDw+IaCXyxlclb/vZK3NyWV0K/TYCsv/TNRg9M2wlqIAEqsFygN9PyLkJ9lkmyNphLL+j5K0skzTcF8DOPzltnjFGVdJFeto116+eO0HEp+haSNHXFF5vvlBwFtRoo/Y5toNrFfJJooPaO/un7/AKSn4sik/ph+q7yWWT1ejUS5sV1Vj61ltVoA10UJzzt79sh/BXIHTCYaWsMWMw+/N/UjizhcjF1R9XatVsKjJB7d5wkAGGicSkt7NgkzRakzuCZtZ97zogwVrMVvUiwKS/v57A9eKpa3TbT6LFsGj22Dt1DIsnhQZJycoEx7hNry6qf04HnUPKnE926QaRc2swWP8rX3Q6dfY9iUHJDZx1UJXCQDBVvxO00BsVqarlXf9QSfEQe9K+npjMrxDnebdXNpYPX8BblLK77kvd7ly6nIEPmuNVNpaBGTWfV686NejcoxhFzZwXW79zAnxkCeHIBkAIkx73H17XjDa9deR8BIxuPC9QFznb6TwjpKjJ7q/x4LSKGAyR63hyQwQ7UiIinsY995WzqkHxj+6hGPdrU0vhlfAJKh5+Dn8O6f6ldkvuY+wMS0jAzRomPU28S1F3II+AvP4YWDEPtrWvSiveEcymFHJiIWCE86Ij7Kag5/g5NX2kyCZ8SVcyLO2pyvYLnwshQL0WiY/cTLqmvNb+iP+0MUYkWNFBWFMdKW7pZTgfiydDY9V8mHhV2hDnebdXNpYPX8BblLK77ku00nfTPXpoGZZkVO7DBXtGvtVYHAm5bIg28aN0w1x+WRyfuP5QqaF5iW5ublNGzW+9deR8BIxuPC9QFznb6Twj7KoHtg1a55NO2q/AB3eUQ+aaRQSaErssTC+hefEw4a3THAMBKaTOeh4IRWbVh1lIPsZQ8toUn2rdR+T6HIufXkQAg1klhryfkt8ilm/zscQQ53m3VzaWD1/AW5Syu+5LIxPn5Kgi3FN3WKA7JQqrOTrDEIR6YxVhfsfFzw8aTK5C+R/uIfPbE447GiJvpQSWON0Il1CXFoGgk26adz1JSCs8lnq/FWinmregcyhOofCoGERAVygDKlUO9Mycl6FEmRW5Ej85U2JDiblUNaAbq91yOSdp5S54zv/wVdT8lNcg7Yug651xLbV0NiLjcbspjbxyupDRMmkUvO3LV6O8d/JBMise0G+ukftlr+k3Pyo=' WHERE `ALIAS` = 'taskListFiledConf';

-- 2023-09-12 jjx 修改流转任务接收人表审批意见值为500
ALTER TABLE `bpm_trans_receiver` MODIFY COLUMN `OPINION_` varchar(500) ;

-- 2023-09-13 jjx 修改日志配置form默认为开启
UPDATE `portal_sys_logs_settings` SET  `STATUS_` = '1' WHERE `ID_` = '3';

-- 2023-09-21 liangjc 对话框树形数据旧数据修复
ALTER TABLE form_custom_dialog ALTER COLUMN TREE_DATA_MODE_ SET DEFAULT 0;
update form_custom_dialog set TREE_DATA_MODE_=0 where TREE_DATA_MODE_ is null;