
-- 2022-8-3 liangjc PORTAL_SYS_MENU 增加菜单类型
ALTER TABLE PORTAL_SYS_MENU ADD TYPE_ VARCHAR(50);
comment on column PORTAL_SYS_MENU.TYPE_ is '菜单类型';


-- 2022-08-08 yujl 增加account账号字段
alter table portal_biz_system_auth add ACCOUNT_ varchar(64);
comment on column portal_biz_system_auth.ACCOUNT_ is '账号';

-- 2022-8-11 liangjc pgsql用int2接收实体Boolean字段报错问题
ALTER TABLE portal_sys_mail_setting drop use_ssl_;
ALTER TABLE portal_sys_mail_setting ADD use_ssl_ boolean;
ALTER TABLE portal_sys_mail_setting drop is_validate_;
ALTER TABLE portal_sys_mail_setting ADD is_validate_ boolean;
ALTER TABLE portal_sys_mail_setting drop is_handle_attach_;
ALTER TABLE portal_sys_mail_setting ADD is_handle_attach_ boolean;
ALTER TABLE portal_sys_mail_setting drop is_delete_remote_;
ALTER TABLE portal_sys_mail_setting ADD is_delete_remote_ boolean;


-- liangjc 2022-8-12 修改字段长度
alter table form_meta alter column name_ type varchar(150) using name_::varchar(150);
alter table form_print_template alter column file_name type varchar(150) using file_name::varchar(150);
alter table portal_sys_menu alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_sys_logs_settings alter column remark_ type varchar(1000) using remark_::varchar(1000);
alter table uc_role  alter column description_ type varchar(150) using description_::varchar(150);
alter table portal_service_choreography  alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_interface_manager  alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_connection_manager  alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_sys_datasource  alter column name_ type varchar(150) using name_::varchar(150);
alter table form_custom_chart  alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_sys_app  alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_sys_app  alter column desc_ type varchar(150) using desc_::varchar(1000);
alter table portal_biz_system  alter column sys_code_ type varchar(150) using sys_code_::varchar(150);
alter table portal_biz_system  alter column sys_name_ type varchar(150) using sys_name_::varchar(150);
alter table portal_biz_system alter column root_address_ type varchar(150) using root_address_::varchar(1000);
alter table portal_biz_system alter column home_address_ type varchar(150) using home_address_::varchar(1000);
alter table portal_biz_system alter column bpm_msg_queue_ type varchar(150) using bpm_msg_queue_::varchar(150);
alter table portal_sys_module alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_sys_module alter column code_ type varchar(150) using code_::varchar(150);
alter table portal_sys_properties alter column name type varchar(150) using name::varchar(150);
alter table portal_sys_properties alter column alias type varchar(150) using alias::varchar(150);
alter table portal_sys_properties alter column group_ type varchar(150) using group_::varchar(150);
alter table portal_sys_properties alter column description type varchar(1000) using description::varchar(1000);
alter table uc_role alter column name_ type varchar(150) using name_::varchar(150);
alter table uc_tenant_manage alter column name_ type varchar(150) using name_::varchar(300);
alter table uc_tenant_manage alter column name_front_ type varchar(150) using name_front_::varchar(300);
alter table uc_tenant_manage alter column shorthand_ type varchar(150) using shorthand_::varchar(150);
alter table bpm_agent_setting alter column subject_ type varchar(150) using subject_::varchar(150);
alter table form_bo_def alter column description_ type varchar(150) using description_::varchar(150);
alter table portal_sys_msg_tpl alter column key_ type varchar(150) using key_::varchar(150);
alter table portal_sys_msg_tpl alter column sms_template_no_ type varchar(150) using sms_template_no_::varchar(150);
alter table portal_sys_msg_tpl alter column voice_template_no_ type varchar(150) using voice_template_no_::varchar(150);
alter table portal_sys_msg_tpl alter column subject_ type varchar(1000) using subject_::varchar(1000);
alter table bpm_multi_script alter column method_desc_ type varchar(1000) using method_desc_::varchar(1000);
alter table bpm_script alter column name_ type varchar(150) using name_::varchar(150);
alter table bpm_script alter column memo_ type varchar(1000) using memo_::varchar(1000);
alter table portal_flow_upload_properties alter column name_ type varchar(150) using name_::varchar(150);
alter table portal_flow_upload_properties alter column location_ type varchar(300) using location_::varchar(300);
alter table portal_flow_upload_properties alter column ftp_url_ type varchar(300) using ftp_url_::varchar(300);
alter table portal_flow_upload_properties alter column ftp_port_ type varchar(300) using ftp_port_::varchar(300);
alter table portal_flow_upload_properties alter column ftp_user_name_ type varchar(150) using ftp_user_name_::varchar(150);
alter table portal_flow_upload_properties alter column ftp_password_ type varchar(150) using ftp_password_::varchar(150);
alter table portal_flow_upload_properties alter column desc_ type varchar(1000) using desc_::varchar(1000);
alter table portal_biz_system_auth alter column sys_name_ type varchar(150) using sys_name_::varchar(150);

-- yijj 修改菜单旧数据
UPDATE PORTAL_SYS_MENU
SET TYPE_ = 'catalog'
WHERE
	ID_ IN ( SELECT t.id_ FROM ( SELECT id_ FROM PORTAL_SYS_MENU WHERE ROUTE_EXTEND_ LIKE '%"MultilevelMenuLayout%' OR ROUTE_EXTEND_ LIKE '%"Layout%' OR ROUTE_EXTEND_ IS NULL ) t );
UPDATE PORTAL_SYS_MENU
SET type_ = 'page'
WHERE
	id_ NOT IN ( SELECT t.id_ FROM ( SELECT id_ FROM PORTAL_SYS_MENU WHERE ROUTE_EXTEND_ LIKE '%"MultilevelMenuLayout%' OR ROUTE_EXTEND_ LIKE '%"Layout%' OR ROUTE_EXTEND_ IS NULL ) t );
