/*
 change.sql 说明
 1.数据库相关修改添加到对应的 change.sql 文件，无需调整其他 sql  文件
 2.sql 语句验证正确后再提交
*/
-- 2023-3-6 liangjc 会议室配置默认不需要绑定流程脚本补充
update portal_meeting_config set BIND_FLOW_=0;

-- wanghb 2023-02-27 日志配置表新增字段

ALTER TABLE portal_sys_logs_settings ADD FROM_ NVARCHAR2(1);
COMMENT ON COLUMN portal_sys_logs_settings.FROM_ IS '1:初始化。2:手动添加';

ALTER TABLE portal_sys_logs_settings ADD MODULE_NAME_ NVARCHAR2(200);
COMMENT ON COLUMN portal_sys_logs_settings.MODULE_NAME_ IS '模块名称';

-- 2023-03-02 字典表新增字段
ALTER TABLE "PORTAL_SYS_DIC"
    ADD ("CREATE_TIME_" DATE)
ADD ("CREATE_BY_" NVARCHAR2(255));

COMMENT ON COLUMN "PORTAL_SYS_DIC"."CREATE_TIME_" IS '创建时间';

COMMENT ON COLUMN "PORTAL_SYS_DIC"."CREATE_BY_" IS '创建人id';

-- 2023-3-17 wanghb 会签数据表新增任务来源字段。
ALTER TABLE bpm_task_signdata ADD FROM_ NVARCHAR2(64);
COMMENT ON COLUMN bpm_task_signdata.FROM_ IS '来源。assign由指定历史会签处理人产生的';

-- 2023-7-7 jjx 同步8.2_pre的脚本内容
alter table BPM_DEFINITION  add DESIGN_PATTERN_ NVARCHAR2(20);
comment on column BPM_DEFINITION.DESIGN_PATTERN_ is '设计模式';

create table BPM_CHECK_RECORD(
    ID_             NVARCHAR2(64)   NOT NULL,
    TENANT_ID_      NVARCHAR2(64),
    CREATE_TIME_    DATE,
    UPDATE_TIME_    DATE,
    CREATE_BY_      NVARCHAR2(64),
    TASK_ID_        NVARCHAR2(64),
    INST_ID_        NVARCHAR2(64),
    CREATE_ORG_ID_  NVARCHAR2(64),
    UPDATE_BY_      NVARCHAR2(64),
	PRIMARY KEY (ID_)
);
comment on table BPM_CHECK_RECORD is '任务阅读记录';
comment on column BPM_CHECK_RECORD.TENANT_ID_ is '租户ID';
comment on column BPM_CHECK_RECORD.CREATE_TIME_ is '创建时间';
comment on column BPM_CHECK_RECORD.UPDATE_TIME_ is '更新时间';
comment on column BPM_CHECK_RECORD.CREATE_BY_ is '创建人';
comment on column BPM_CHECK_RECORD.TASK_ID_ is '任务ID';
comment on column BPM_CHECK_RECORD.INST_ID_ is '实例ID';

UPDATE portal_sys_properties SET NAME = '待办列表字段显示配置', ALIAS = 'taskListFiledConf', GROUP_ = NULL,
                                   VALUE = 'MvLiL4mE1+YRNj4cfPOGzXCMA5F/amaoWCA2iUnRVhcK9aZEof2/M5Ii3zWaCcQBtNG6T6/bDsspNohzSqq8MBg+UkEo+A+fojqBP9nm9s/mxAH5v+HcvPi7H00ryd0W0eMInCQ2rplU+UgHvJNr0D8+1FkL/EyQPsOG5SazUTWOWI14OS+R1tHUvVzGk6jSxrZqAz5Pi5RTNDitHrypfbF9nas8LjVzqrnYGrRimXaSaPX7zmNtlm+NoKRpX0ckQDyjgSvwAgnLtSbyqiTS4AMBxjGgbzHEtD+UwDcyWFD/y99DaWyKe1CkC/kfZ4mr5cRTrOUWsGIHBsHnz+Czx3Ip6tQxeSxFm3A4xn0YWzDENJLO7IPN9bixemLAj38RGZf+/2+uFRZx/WKKiVUHYuBxrvZN/E9Qxxg0JMpXPC4srBSSngEFv72KDwc1t7lpQ8+nOduRG5dkZcl9Do+qRj7JH6CouiXEyXZybr7hItFKZiClQgfDGd5wldTxTZ0apGjFB8lNecOIvY+DelsMAKG5+8VqplSVF3S6zJ6+kxqIt4OcPTIm+MPUgIFeLbm9XJ1Kn0tdEk5PhsiWdYBVrrhFafpPzw/AXsQAYZgh7T1TCnYGUidLOis1G8khS4T7QDyjgSvwAgnLtSbyqiTS4HtJ/Yl9yGzl/94R0THof8UO6B1Ej+GnOnQEFRi2izAf5cRTrOUWsGIHBsHnz+Czx3Ip6tQxeSxFm3A4xn0YWzAa38uRHjrujYZ4pZX1yWAEpGjFB8lNecOIvY+DelsMANq/cufeuL275D7sZygkW0WQ57F5AtPCv6Wki5lAM0CBL25Enrb6+rlNuY32fRM0z7OMt4w6vXJHgjkO4Txe4/srk4QuiRDQvyq9K+wGQLQNuVl7HPlrJDfOPnb2xbCOxzoWCUKQpYW9tKqrx692LMILy5x9J/NfUxSi3gtHMI1RX6LfluBuGRpjhcDsxxaxeuSZGrk7zbVgoGRM49OtyaS/GnH7v+Xskxs4/geWWITXL/QE10IQ2v6ewmFdLAPwdZF2NNzjnuS+GkbyHPVH0bsP/eux6jbu1R2wK9GjI4MP/iYjy9b7jaqbc/XYGtFM6EigZrL18hlemzh/Fvu7/oIQD2Pe+5+2JS2EmXX4zF29VG5OCoeL5VM11eDDbZn4a0A8o4Er8AIJy7Um8qok0uCjZmgZKQ6XiFCyp9UNkumLJA32CqzvKUNEPNLwf+CR7eXEU6zlFrBiBwbB58/gs8dyKerUMXksRZtwOMZ9GFswB3chkFVZb6XCc45/PdrIYfl4c0Vbog/TuxP3MMXBpXbiEGklcBZ0q1FsT2tSEMBwOd6njPSzdZF2cVWQSvZ+IUA8dxrZx2EGWpBF11V6cfBWup6zeRqkyJTBIaVQzubzEs/ZpNz8lKFyCEBsdEgalnVPakFyhb8G0ea5P3CAlreN6TBxepcUHthlX77p5CuPGOA+8yi2NynjMKDXg9Awklca0dcpoMR1Ofat3kj4YuzTzbMrfilpzvg8cWw3e1wpZQtx04v+/jzDBbCC8JXJz7lZexz5ayQ3zj529sWwjsfyIJ/lSzTXRC7Kp1P1uBBn/vFT7Gy1mpBZk9tpUGzLVbuNtUx7/8H2OaeT73vqems4Z5KEjTP+oIX9LWzRxee0UaHFyfk6CgnGeF4CwTIdw0A8o4Er8AIJy7Um8qok0uCjmdwbIcTthJHSl8xgXePabA8lXEkV/j2ESgV5AS/N8lhJyDS5ZqlumY28Bawy49EQD2Pe+5+2JS2EmXX4zF29an1LjdWEv13RH3vqxzFW2+IQaSVwFnSrUWxPa1IQwHB/eigOQncmnJkQFuV61QidQDx3GtnHYQZakEXXVXpx8Fa6nrN5GqTIlMEhpVDO5vMSz9mk3PyUoXIIQGx0SBqWEbFvnZzHRIliGHlLOUY3cA==',
                                   ENCRYPT = 1,
                                   DESCRIPTION = '应用端待办列表字段显示配置',
                                   UPDATE_TIME_ = NULL,
                                   CREATE_BY_ = NULL,
                                   CREATE_TIME_ = NULL,
                                   CREATE_ORG_ID_ = NULL,
                                   UPDATE_BY_ = NULL,
                                   TENANT_ID_ = NULL
                               WHERE ALIAS = 'taskListFiledConf';


alter table BPM_DEFINITION add FLOW_TYPE_ int;
comment on column BPM_DEFINITION.FLOW_TYPE_ is '流程类型';

alter table BPM_TASK_REMINDER add TRANSFER_ID_ NVARCHAR2(64);
comment on column BPM_TASK_REMINDER.TRANSFER_ID_ is '转办人ID';

alter table BPM_TASK_REMINDER add TRANSFER_NAME_ NVARCHAR2(255);
comment on column BPM_TASK_REMINDER.TRANSFER_NAME_ is '转办人名称';

alter table BPM_TASK_REMINDER add DIRECT_LEADER_ int;
comment on column BPM_TASK_REMINDER.DIRECT_LEADER_ is '催办直接上级';

alter table BPM_TASK_REMINDER add MAIN_ORG_LEADER_ int;
comment on column BPM_TASK_REMINDER.MAIN_ORG_LEADER_ is '催办主组织负责人';

alter table BPM_TASK_REMINDER add DIRECT_USER_IDS_ NVARCHAR2(1000);
comment on column BPM_TASK_REMINDER.DIRECT_USER_IDS_ is '指定用户ID';

alter table BPM_TASK_REMINDER add DIRECT_USER_NAMES_ NVARCHAR2(1000);
comment on column BPM_TASK_REMINDER.DIRECT_USER_NAMES_ is '指定用户名称';

alter table BPM_TASK_REMINDER add DIRECT_USER_ int;
comment on column BPM_TASK_REMINDER.DIRECT_USER_ is '催办指定用户';

UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1318030354614980608';
UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1338367741324824576';
UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1338375124944031744';
UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1338377219818524672';
UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1338379764150439936';
UPDATE bpm_multi_script SET TENANT_ID_ = '-1' WHERE ID_ = '1338381406014935040';


alter table PORTAL_SYS_LOGS add ELAPSED_TIME_ decimal(10, 3);
comment on column PORTAL_SYS_LOGS.ELAPSED_TIME_ is '接口耗时（单位：秒）';

alter table BPM_CALL_LOG add ELAPSED_TIME_ DECIMAL(10, 3);
comment on column BPM_CALL_LOG.ELAPSED_TIME_ is '接口耗时（单位：秒）';

INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_, TYPE_) VALUES ('1572106298114183168', '3641025', '简易流程', 'simpleFlowTable', '', '', 1, 2, '', '-1.1.3641025.1572106298114183168.', '', '-1', '{\"path\":\"/simpleFlowTable\",\"component\":\"\",\"redirect\":\"\",\"alwaysShow\":false,\"caseSensitive\":false,\"meta\":{\"title\":\"简易流程\"}}', NULL);

create table FORM_SIMPLE_DESIGN
(
    ID_             NVARCHAR2(50)   NOT NULL,
    CATEGORY_ID_    NVARCHAR2(50),
    CATEGORY_NAME_  NVARCHAR2(255),
    ALIAS_          NVARCHAR2(50),
    NAME_           NVARCHAR2(150),
    CREATE_BY_      NVARCHAR2(50),
    CREATE_TIME_    DATE,
    CREATE_ORG_ID_  NVARCHAR2(64),
    UPDATE_BY_      NVARCHAR2(64),
    UPDATE_TIME_    DATE,
    DESC_           NVARCHAR2(255),
    TENANT_ID_      NVARCHAR2(64),
	PRIMARY KEY (ID_)
);
comment on table FORM_SIMPLE_DESIGN is '简易设计';
comment on column FORM_SIMPLE_DESIGN.CATEGORY_ID_ is '分类ID';
comment on column FORM_SIMPLE_DESIGN.CATEGORY_NAME_ is '分类名称';
comment on column FORM_SIMPLE_DESIGN.ALIAS_ is '别名';
comment on column FORM_SIMPLE_DESIGN.NAME_ is '名称';
comment on column FORM_SIMPLE_DESIGN.CREATE_BY_ is '创建人ID';
comment on column FORM_SIMPLE_DESIGN.CREATE_TIME_ is '创建时间';
comment on column FORM_SIMPLE_DESIGN.UPDATE_BY_ is '更新人ID';
comment on column FORM_SIMPLE_DESIGN.UPDATE_TIME_ is '更新时间';
comment on column FORM_SIMPLE_DESIGN.DESC_ is '描述';
comment on column FORM_SIMPLE_DESIGN.TENANT_ID_ is '租户ID';
create index IDX_FORM_BO_DEF_ALIAS_   on FORM_SIMPLE_DESIGN (ALIAS_, TENANT_ID_);

INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_, TYPE_, IS_REFRESH_, token_Enabled_, TOKEN_TYPE_, TOKEN_KEY_, TOKEN_API_) 
VALUES ('1631183759799828480', '1441341228585766912', '个人信息', 'information', '', '', NULL, 1, '', '-1.3.1441341228585766912.1631183759799828480.', '', '-1', '{\"path\":\"information\",\"component\":\"@/views/personal/information\",\"redirect\":\"\",\"alwaysShow\":false,\"caseSensitive\":false,\"meta\":{\"title\":\"个人信息\",\"isChildren\":true,\"icon\":\"\"}}', 'page', 1, 0, 0, NULL, NULL);

INSERT INTO portal_i18n_message(ID_, TYPE_, KEY_, VALUE_, CREATE_TIME_, CREATE_BY_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_, TENANT_ID_) 
VALUES ('1630743663304851456', 'en', 'Personal.center', 'Personal center', NULL, 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 ('1630743663363571712', 'zh-TW', 'Personal.center', '個人中心', NULL, 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 ('1630743663392931840', 'zh-CN', 'Personal.center', '个人中心', NULL, NULL, NULL, NULL, NULL, '-1');

alter table FORM_HISTORY_RECORD add FORM_CSS_ CLOB;
comment on column FORM_HISTORY_RECORD.FORM_CSS_ is '表单CSS脚本';

alter table FORM_DEFINITION add FORM_CSS_ CLOB;
comment on column FORM_DEFINITION.FORM_CSS_ is '表单CSS脚本';

create table BPM_FREE_PROCESS_DEF
(
    ID_            	NVARCHAR2(64) NOT NULL,
    SOURCE_DEF_ID_ 	NVARCHAR2(64),
    PROC_INST_ID_  	NVARCHAR2(255),
    BPMN_XML_      	CLOB,
    TENANT_ID_     	NVARCHAR2(255),
		PRIMARY KEY (ID_)
);
comment on table BPM_FREE_PROCESS_DEF is '自由流程定义备份表';
comment on column BPM_FREE_PROCESS_DEF.ID_ is '新流程定义ID';
comment on column BPM_FREE_PROCESS_DEF.SOURCE_DEF_ID_ is '原流程定义ID';
comment on column BPM_FREE_PROCESS_DEF.PROC_INST_ID_ is '实例ID';
comment on column BPM_FREE_PROCESS_DEF.BPMN_XML_ is 'XML';
comment on column BPM_FREE_PROCESS_DEF.TENANT_ID_ is '租户ID';

create table BPM_SERVICE_LOG(
    ID_           	NVARCHAR2(64) NOT NULL,
    SUBJECT_      	NVARCHAR2(600),
    PROC_DEF_ID_  	NVARCHAR2(64),
    PROC_INST_ID_ 	NVARCHAR2(64),
    NODE_ID_      	NVARCHAR2(64),
    STATUS_       	INT,
    CREATE_TIME_  	DATE,
    TENANT_ID_    	NVARCHAR2(64),
		PRIMARY KEY (ID_)
);
comment on table BPM_SERVICE_LOG is '服务节点执行日志';
comment on column BPM_SERVICE_LOG.SUBJECT_ is '流程标题';
comment on column BPM_SERVICE_LOG.PROC_DEF_ID_ is '流程定义ID';
comment on column BPM_SERVICE_LOG.PROC_INST_ID_ is '流程实例ID';
comment on column BPM_SERVICE_LOG.NODE_ID_ is '节点ID';
comment on column BPM_SERVICE_LOG.STATUS_ is '处理结果：1.处理成功  0.处理失败';
comment on column BPM_SERVICE_LOG.TENANT_ID_ is '租户ID';
create index PROC_INST_ID_  on BPM_SERVICE_LOG (PROC_INST_ID_);

create table BPM_DOCUMENTATION_CONFIG
(
    ID_             NVARCHAR2(255)  NOT NULL,
    DATA_KEY_       NVARCHAR2(255),
    AUTORUN_        NVARCHAR2(10),
    AUTORUN_CONFIG_ NVARCHAR2(255),
    DELETE_DATA_    NVARCHAR2(10),
    LIMIT_          NVARCHAR2(10),
    LIMIT_NUMBER_   NVARCHAR2(255),
    UPDATE_BY_      NVARCHAR2(255),
    UPDATE_TIME_    DATE,
    BEFORE_MONTH_   NVARCHAR2(255),
    JOB_NAME_       NVARCHAR2(255),
    TENANT_ID_      NVARCHAR2(255),
				PRIMARY KEY (ID_)
);
comment on table BPM_DOCUMENTATION_CONFIG is '数据归档配置表';
comment on column BPM_DOCUMENTATION_CONFIG.DATA_KEY_ is '数据源key';
comment on column BPM_DOCUMENTATION_CONFIG.AUTORUN_ is '是否自动执行';
comment on column BPM_DOCUMENTATION_CONFIG.AUTORUN_CONFIG_ is '自动执行配置';
comment on column BPM_DOCUMENTATION_CONFIG.DELETE_DATA_ is '是否删除数据';
comment on column BPM_DOCUMENTATION_CONFIG.LIMIT_ is '是否限制数据';
comment on column BPM_DOCUMENTATION_CONFIG.LIMIT_NUMBER_ is '限制数量';
comment on column BPM_DOCUMENTATION_CONFIG.UPDATE_BY_ is '修改人';
comment on column BPM_DOCUMENTATION_CONFIG.UPDATE_TIME_ is '修改时间';
comment on column BPM_DOCUMENTATION_CONFIG.BEFORE_MONTH_ is '同步时间';
comment on column BPM_DOCUMENTATION_CONFIG.JOB_NAME_ is '定时任务名称';
comment on column BPM_DOCUMENTATION_CONFIG.TENANT_ID_ is '租户ID';


create table BPM_DOCUMENTATION_ERROR_LOG
(
    ID_         NVARCHAR2(255) NOT NULL,
    TABLE_NAME_ NVARCHAR2(255),
    DATA_ID_    NVARCHAR2(255),
    DATA_       NVARCHAR2(1000),
    REASON_     CLOB,
    TABLE_ID_   NVARCHAR2(255),
    TIME_       date,
    TENANT_ID_  NVARCHAR2(255),
		PRIMARY KEY (ID_)
);
comment on table BPM_DOCUMENTATION_ERROR_LOG is '同步错误日志表';
comment on column BPM_DOCUMENTATION_ERROR_LOG.TABLE_NAME_ is '表名';
comment on column BPM_DOCUMENTATION_ERROR_LOG.DATA_ID_ is '数据ID';
comment on column BPM_DOCUMENTATION_ERROR_LOG.DATA_ is '数据';
comment on column BPM_DOCUMENTATION_ERROR_LOG.REASON_ is '失败原因';
comment on column BPM_DOCUMENTATION_ERROR_LOG.TABLE_ID_ is '数据表ID';
comment on column BPM_DOCUMENTATION_ERROR_LOG.TIME_ is '时间';
comment on column BPM_DOCUMENTATION_ERROR_LOG.TENANT_ID_ is '租户ID';

create table BPM_DOCUMENTATION_TABLE
(
    ID_           NVARCHAR2(255) NOT NULL,
    TABLE_NAME_   NVARCHAR2(255),
    DML_          CLOB,
    DDL_          CLOB,
    SYSTEM_       NVARCHAR2(10),
    START_        NVARCHAR2(255),
    INFO_         NVARCHAR2(255),
    ORDER_        NVARCHAR2(255),
    UPDATE_BY_    NVARCHAR2(64),
    PARENT_FIELD_ NVARCHAR2(255),
    FIELD_        NVARCHAR2(255),
    TIME_KEY_     NVARCHAR2(255),
    PARENT_ID_    NVARCHAR2(255),
    UPDATE_TIME_  DATE,
    TENANT_ID_    NVARCHAR2(255),
		PRIMARY KEY (ID_)
);
comment on table BPM_DOCUMENTATION_TABLE is '同步数据目标表';
comment on column BPM_DOCUMENTATION_TABLE.TABLE_NAME_ is '表名';
comment on column BPM_DOCUMENTATION_TABLE.DML_ is '表查询语句';
comment on column BPM_DOCUMENTATION_TABLE.DDL_ is '表定义语句';
comment on column BPM_DOCUMENTATION_TABLE.SYSTEM_ is '是否系统默认表';
comment on column BPM_DOCUMENTATION_TABLE.START_ is '是否启动';
comment on column BPM_DOCUMENTATION_TABLE.INFO_ is '说明';
comment on column BPM_DOCUMENTATION_TABLE.ORDER_ is '同步顺序';
comment on column BPM_DOCUMENTATION_TABLE.UPDATE_BY_ is '创建人';
comment on column BPM_DOCUMENTATION_TABLE.PARENT_FIELD_ is '主表字段';
comment on column BPM_DOCUMENTATION_TABLE.FIELD_ is '子表字段';
comment on column BPM_DOCUMENTATION_TABLE.TIME_KEY_ is '同步表时间字段';
comment on column BPM_DOCUMENTATION_TABLE.PARENT_ID_ is '父表ID';
comment on column BPM_DOCUMENTATION_TABLE.UPDATE_TIME_ is '创建时间';
comment on column BPM_DOCUMENTATION_TABLE.TENANT_ID_ is '租户';

alter table FORM_DATA_TEMPLATE add SHOW_TYPE_ NVARCHAR2(20);
comment on column FORM_DATA_TEMPLATE.SHOW_TYPE_ is '展示类型';

alter table FORM_DATA_TEMPLATE add GANTT_CONFIG_ CLOB;
comment on column FORM_DATA_TEMPLATE.GANTT_CONFIG_ is '甘特图独有一些配置';

alter table FORM_DATA_TEMPLATE add KANBAN_CONFIG_ CLOB;
comment on column FORM_DATA_TEMPLATE.KANBAN_CONFIG_ is '看板独有一些配置';

alter table FORM_DATA_TEMPLATE add XMIND_CONFIG_ CLOB;
comment on column FORM_DATA_TEMPLATE.XMIND_CONFIG_ is '思维导图的配置';

alter table PORTAL_SYS_COLUMN ADD SNAPSHOT_ID_ NVARCHAR2(64);
comment on column PORTAL_SYS_COLUMN.SNAPSHOT_ID_ is '快照图片id';

alter table  PORTAL_SYS_COLUMN ADD TEMPLATE_STYLE_ CLOB;
comment on column PORTAL_SYS_COLUMN.TEMPLATE_STYLE_ is '模板样式';

create table PORTAL_RECENTLY_APP
(
    ID_             VARCHAR(64) NOT NULL,
    APP_ID_         VARCHAR(64),
    ACCOUNT_        VARCHAR(64),
    COUNT_          INT,
    CREATE_TIME_    DATE,
    UPDATE_TIME_    DATE,
    CREATE_BY_      VARCHAR(64),
    CREATE_ORG_ID_  VARCHAR(64),
    UPDATE_BY_      VARCHAR(64),
    TENANT_ID_      int,
		PRIMARY KEY (ID_)
);
comment on table PORTAL_RECENTLY_APP is '用户最近应用点击记录表';
comment on column PORTAL_RECENTLY_APP.APP_ID_ is '应用ID';
comment on column PORTAL_RECENTLY_APP.ACCOUNT_ is '用户账号';
comment on column PORTAL_RECENTLY_APP.COUNT_ is '点击次数';
comment on column PORTAL_RECENTLY_APP.CREATE_TIME_ is '创建时间';
comment on column PORTAL_RECENTLY_APP.UPDATE_TIME_ is '更新时间';
comment on column PORTAL_RECENTLY_APP.CREATE_BY_ is '创建人';
comment on column PORTAL_RECENTLY_APP.UPDATE_BY_ is '更新人';

alter table PORTAL_SYS_LAYOUT_MANAGE add BANNER_TYPE_IDS_ CLOB;
comment on column PORTAL_SYS_LAYOUT_MANAGE.BANNER_TYPE_IDS_ is '轮播图分类IDS';

alter table FORM_DATA_TEMPLATE add MOBILE_DISPLAY_FIELD_ CLOB;
comment on column FORM_DATA_TEMPLATE.MOBILE_DISPLAY_FIELD_ is '移动端显示字段';

alter table FORM_DATA_TEMPLATE add MOBILE_MANAGE_FIELD_ CLOB;
comment on column FORM_DATA_TEMPLATE.MOBILE_MANAGE_FIELD_ is '移动端功能按钮';

INSERT INTO BPM_DOCUMENTATION_config(ID_, DATA_KEY_, AUTORUN_, AUTORUN_CONFIG_, DELETE_DATA_, LIMIT_,
                                          LIMIT_NUMBER_, UPDATE_BY_, UPDATE_TIME_, BEFORE_MONTH_, JOB_NAME_,
                                         TENANT_ID_)
VALUES ('1', NULL, '1', '{\"type\":4,\"timeInterval\":\"MON,TUE,WED,SUN|11:49:20\"}', '2', '1', '500', '1',
        null, '0', '流程归档数据同步', '-1');

alter table FORM_DATA_TEMPLATE  add MOBILE_TEMPLATE_ALIAS_ NVARCHAR2(128);
comment on column FORM_DATA_TEMPLATE.MOBILE_TEMPLATE_ALIAS_ is '移动端数据模板别名';

alter table FORM_DATA_TEMPLATE add MOBILE_TEMPLATE_HTML_ CLOB;
comment on column FORM_DATA_TEMPLATE.MOBILE_TEMPLATE_HTML_ is '移动端数据模板代码'; 
 
ALTER TABLE PORTAL_SYS_APP  ADD ALIAS_ NVARCHAR2(64);
comment on column PORTAL_SYS_APP.ALIAS_ is '应用别名';

ALTER TABLE PORTAL_SYS_APP_MENU  ADD MENU_TYPE_ NVARCHAR2(64);
comment on column PORTAL_SYS_APP_MENU.MENU_TYPE_ is '菜单类型';

ALTER TABLE PORTAL_SYS_APP_MENU  ADD ICON_ NVARCHAR2(64);
comment on column PORTAL_SYS_APP_MENU.ICON_ is '图标';

alter table PORTAL_SYS_APP_MENU modify SN_ INT;
ALTER TABLE PORTAL_SYS_APP_MENU MODIFY SN_  NOT NULL;


UPDATE PORTAL_SYS_MENU  SET ALIAS_ = 'pcAppCenter' WHERE NAME_ = 'pc模块';

INSERT INTO portal_sys_auth_user (ID_, AUTHORIZE_ID_, OWNER_ID_, OWNER_NAME_, RIGHT_TYPE_, OBJ_TYPE_, TENANT_ID_) VALUES ('1656920738508091392', '1651467475169812480', NULL, NULL, 'everyone', 'indexColumn', '-1');
INSERT INTO portal_sys_auth_user (ID_, AUTHORIZE_ID_, OWNER_ID_, OWNER_NAME_, RIGHT_TYPE_, OBJ_TYPE_, TENANT_ID_) VALUES ('1656921529427996672', '1651134508916514816', NULL, NULL, 'everyone', 'indexColumn', '-1');
INSERT INTO portal_sys_auth_user (ID_, AUTHORIZE_ID_, OWNER_ID_, OWNER_NAME_, RIGHT_TYPE_, OBJ_TYPE_, TENANT_ID_) VALUES ('1656921540433850368', '1651056986864828416', NULL, NULL, 'everyone', 'indexColumn', '-1');

alter table BPM_DEFINITION  add DEPLOY_DESC_ VARCHAR(500);
comment on column BPM_DEFINITION.DEPLOY_DESC_ is '发布说明';

create table BPM_SHOW_RECORD(
    ID_            VARCHAR(32)	 not null ,
    ACCOUNT_       VARCHAR(32)	 not null,
    FULL_NAME_     VARCHAR(32)	 not null,
    SHOW_TIME_     DATE       	 not null,
    TASK_ID_       VARCHAR(32),
    ACTION_        VARCHAR(32),
    SHOW_TYPE_     VARCHAR(20),
    REASONS_       CLOB       	 not null,
    CREATE_BY_     VARCHAR(32),
    CREATE_TIME_   DATE,
    CREATE_ORG_ID_ VARCHAR(32),
    UPDATE_BY_     VARCHAR(32),
    UPDATE_TIME_   DATE,
    TENANT_ID_     VARCHAR(32),
		PRIMARY KEY(ID_)
);
comment on table BPM_SHOW_RECORD is '流程实例和流程任务查阅记录';
comment on column BPM_SHOW_RECORD.ID_ is '主键ID';
comment on column BPM_SHOW_RECORD.ACCOUNT_ is '查阅人账号';
comment on column BPM_SHOW_RECORD.FULL_NAME_ is '查阅人名称';
comment on column BPM_SHOW_RECORD.SHOW_TIME_ is '查阅时间';
comment on column BPM_SHOW_RECORD.TASK_ID_ is '流程实例ID或任务ID';
comment on column BPM_SHOW_RECORD.ACTION_ is '流程定义中的动作：发布新版本/保存';
comment on column BPM_SHOW_RECORD.SHOW_TYPE_ is '展示类型：实例/任务/流程定义';
comment on column BPM_SHOW_RECORD.REASONS_ is '查阅原因';
comment on column BPM_SHOW_RECORD.CREATE_BY_ is '创建人';
comment on column BPM_SHOW_RECORD.CREATE_TIME_ is '创建时间';
comment on column BPM_SHOW_RECORD.UPDATE_BY_ is '更新人';
comment on column BPM_SHOW_RECORD.UPDATE_TIME_ is '更新时间';
comment on column BPM_SHOW_RECORD.TENANT_ID_ is '租户ID';
create index SHOW_RECORD_TASK_ID_   on BPM_SHOW_RECORD (TASK_ID_, SHOW_TYPE_);

alter table FORM_DATA_TEMPLATE  add INNER_BTN_CONFIG_ CLOB;
comment on column FORM_DATA_TEMPLATE.INNER_BTN_CONFIG_ is '页内按钮的配置';


create table BPM_PRO_PUBLICITY_READ
(
    ID_  VARCHAR(64) 	not null ,
    PROC_INST_ID_ 	VARCHAR(64),
    USER_ID_      	VARCHAR(64),
    TENANT_ID_    	VARCHAR(64),
		PRIMARY KEY(ID_)
);
comment on table BPM_PRO_PUBLICITY_READ is '流程公示阅读记录';
comment on column BPM_PRO_PUBLICITY_READ.PROC_INST_ID_ is '实例ID';
comment on column BPM_PRO_PUBLICITY_READ.USER_ID_ is '用户ID';
create index IDX_USER_ID_USER_ID   on BPM_PRO_PUBLICITY_READ (USER_ID_);
create index BPM_PRO_PUBLICITY_   on BPM_PRO_PUBLICITY_READ (PROC_INST_ID_);

INSERT INTO PORTAL_SYS_MENU (ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_, TYPE_, TOKEN_ENABLED_, TOKEN_TYPE_, TOKEN_KEY_, TOKEN_API_, IS_REFRESH_) VALUES ('1643794670103810048', '4291768', '流程归档', 'historyDataConfig', '', '', null, 7, '', '-1.1.3641025.4291768.1643794670103810048.', '', '-1', '{\"path\":\"historyDataConfig\",\"component\":\"MultilevelMenuLayout\",\"redirect\":\"\",\"alwaysShow\":true,\"caseSensitive\":false,\"meta\":{\"title\":\"流程归档\",\"icon\":\"\",\"isChildren\":true}}', 'catalog', 0, 0, null, null, 1);

delete from portal_sys_menu where NAME_ = '移动端流程分类';

INSERT INTO "QRTZ_JOB_DETAILS"("SCHED_NAME", "JOB_NAME", "JOB_GROUP", "DESCRIPTION", "JOB_CLASS_NAME", "IS_DURABLE", "IS_NONCONCURRENT", "IS_UPDATE_DATA", "REQUESTS_RECOVERY", "JOB_DATA") VALUES ('quartzScheduler', '数据归档定时任务', '-1', '数据归档定时任务', 'com.hotent.job.job.DocumentationJob', '1', '1', '0', '0', HEXTORAW('ACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800'));

INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644250277726375936', 'bpm_pro_inst', '', 'CREATE TABLE bpm_pro_inst (
	ID_ NVARCHAR2(64) NOT NULL,
	SUBJECT_ NVARCHAR2(256) NOT NULL,
	PROC_DEF_ID_ NVARCHAR2(64) NOT NULL,
	BPMN_DEF_ID_ NVARCHAR2(64) DEFAULT NULL,
	PROC_DEF_KEY_ NVARCHAR2(128) DEFAULT NULL,
	PROC_DEF_NAME_ NVARCHAR2(128) NOT NULL,
	BIZ_KEY_ NVARCHAR2(64) DEFAULT NULL,
	SYS_CODE_ NVARCHAR2(64) DEFAULT NULL,
	FORM_KEY_ NVARCHAR2(64) DEFAULT NULL,
	STATUS_ NVARCHAR2(40) DEFAULT NULL,
	END_TIME_ DATE,
	DURATION_ INTEGER DEFAULT NULL,
	TYPE_ID_ NVARCHAR2(64) DEFAULT NULL,
	RESULT_TYPE_ NVARCHAR2(40) DEFAULT NULL,
	BPMN_INST_ID_ NVARCHAR2(64) DEFAULT NULL,
	CREATE_BY_ NVARCHAR2(64) DEFAULT NULL,
	CREATE_TIME_ DATE,
	CREATE_ORG_ID_ NVARCHAR2(64) DEFAULT NULL,
	UPDATE_BY_ NVARCHAR2(64) DEFAULT NULL,
	UPDATE_TIME_ DATE,
	IS_FORMMAL_ CHAR(1) NOT NULL,
	PARENT_INST_ID_ NVARCHAR2(64) DEFAULT NULL,
	IS_FORBIDDEN_ SMALLINT DEFAULT NULL,
	DATA_MODE_ NVARCHAR2(20) DEFAULT NULL,
	CREATOR_ NVARCHAR2(64) DEFAULT NULL,
	SUPPORT_MOBILE_ INTEGER DEFAULT 0,
	SUPER_NODE_ID_ NVARCHAR2(64) DEFAULT NULL,
	IS_DELE_ INTEGER DEFAULT 0 NOT NULL,
	URGENT_STATE_ NVARCHAR2(64) DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	CREATE_ORG_PATH_ CLOB,
	PC_INST_URL_ NVARCHAR2(200),
	MOBILE_INST_URL_ NVARCHAR2(200),
	CREATE_ACCOUNT_ NVARCHAR2(64)，
	CONSTRAINT PK_BPM_PRO_INST PRIMARY KEY (ID_)
);', '1', '1', NULL, '1', '1', NULL, NULL, 'UPDATE_TIME_', '0', null, '-1');


INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644251197944090624', 'bpm_bus_link', NULL, 'CREATE TABLE bpm_bus_link(
	ID_ NVARCHAR2(64) NOT NULL ,
	DEF_ID_ NVARCHAR2(64) DEFAULT NULL,
	PROC_INST_ID_ NVARCHAR2(64) DEFAULT NULL,
	BUSINESSKEY_ INTEGER DEFAULT NULL,
	BUSINESSKEY_STR_ NVARCHAR2(64) DEFAULT NULL,
	SYS_CODE_ NVARCHAR2(64) DEFAULT NULL,
	FORM_IDENTIFY_ NVARCHAR2(64) NOT NULL,
	START_ID_ VARCHARNVARCHAR264) DEFAULT NULL,
	STARTOR_ NVARCHAR2(128) DEFAULT NULL,
	CREATE_DATE_ DATE,
	START_GROUP_ID_ NVARCHAR2(64) DEFAULT NULL,
	START_GROUP_ NVARCHAR2(128) DEFAULT NULL,
	IS_MAIN_ SMALLINT DEFAULT NULL,
	BO_DEF_CODE_ NVARCHAR2(64) DEFAULT NULL,
	SAVE_MODE_ NVARCHAR2(50) DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	PRIMARY KEY(ID_)
);', '1', '0', NULL, '1', '1', 'id_', 'PROC_INST_ID_', NULL, '1644250277726375936', NULL, '-1');

INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644251940189097984', 'bpm_pro_status', NULL, 'CREATE TABLE bpm_pro_status(
	ID_ NVARCHAR2(64) NOT NULL ,
	PROC_INST_ID_ NVARCHAR2(64) NOT NULL,
	PROC_DEF_ID_ NVARCHAR2(64) NOT NULL,
	NODE_ID_ NVARCHAR2(255) NOT NULL,
	NODE_NAME_ NVARCHAR2(255) DEFAULT NULL,
	STATUS_ NVARCHAR2(50) NOT NULL,
	LAST_UPDATE_ DATE,
	LAST_USERID_ NVARCHAR2(64) DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	RECYCLE_NODE_ NVARCHAR2(2) DEFAULT,
	PRIMARY KEY(ID_)
);', '1', '0', NULL, '2', '1', 'id_', 'PROC_INST_ID_', NULL, '1644250277726375936', null, '-1');

INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644252316812431360', 'bpm_check_opinion', NULL, 'CREATE TABLE bpm_check_opinion(
	ID_ NVARCHAR2(64) NOT NULL ,
	PROC_DEF_ID_ NVARCHAR2(64) NOT NULL,
	SUP_INST_ID_ NVARCHAR2(64) DEFAULT NULL,
	PROC_INST_ID_ NVARCHAR2(64) NOT NULL,
	TASK_ID_ NVARCHAR2(64) DEFAULT NULL,
	TASK_KEY_ NVARCHAR2(64) DEFAULT NULL,
	TASK_NAME_ NVARCHAR2(255) DEFAULT NULL,
	TOKEN_ NVARCHAR2(64) DEFAULT NULL,
	QUALFIEDS_ CLOB DEFAULT NULL,
	QUALFIED_NAMES_ CLOB DEFAULT NULL,
	AUDITOR_ NVARCHAR2(64) DEFAULT NULL,
	AUDITOR_NAME_ NVARCHAR2(64) DEFAULT NULL,
	ORG_ID_ NVARCHAR2(64) DEFAULT NULL,
	ORG_PATH_ NVARCHAR2(600) DEFAULT NULL,
	OPINION_ NVARCHAR2(4000) DEFAULT NULL,
	STATUS_ NVARCHAR2(40) NOT NULL,
	FORM_DEF_ID_ NVARCHAR2(64) DEFAULT NULL,
	FORM_NAME_ NVARCHAR2(64) DEFAULT NULL,
	CREATE_TIME_ DATE,
	ASSIGN_TIME_ DATE,
	COMPLETE_TIME_ DATE,
	DUR_MS_ INTEGER DEFAULT NULL,
	FILES_ NVARCHAR2(4000) DEFAULT NULL,
	INTERPOSE_ SMALLINT DEFAULT NULL,
	IS_DELE_ INTEGER DEFAULT 0 NOT NULL,
	IS_READ_ INTEGER DEFAULT 0 NOT NULL,
	AGENT_LEADER_ID_ NVARCHAR2(64) DEFAULT NULL,
	PROP1_ NVARCHAR2(200) DEFAULT NULL,
	PROP2_ NVARCHAR2(200) DEFAULT NULL,
	PROP3_ NVARCHAR2(200) DEFAULT NULL,
	PROP4_ NVARCHAR2(200) DEFAULT NULL,
	PROP5_ NVARCHAR2(200) DEFAULT NULL,
	PROP6_ CLOB,
	Z_FILES_ NVARCHAR2(1000) DEFAULT NULL,
	FORM_DATA_ CLOB,
	PARENT_TASK_ID_ VARCHAR(64) DEFAULT NULL,
	SIGN_TYPE_ NVARCHAR2(64) DEFAULT NULL,
	SKIP_TYPE_ NVARCHAR2(64) DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	VARS_ CLOB,
	QUALFIEDS_ACCOUNT_ CLOB,
	AUDITOR_ACCOUNT_ NVARCHAR2(255),
	PRIMARY KEY(ID_)
);', '1', '0', NULL, '3', '1', 'id_', 'proc_inst_id_', NULL, '1644250277726375936', NULL, '-1');

INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644253067093725184', 'bpm_exe_stack', NULL, 'CREATE TABLE BPM_EXE_STACK (
	ID_ NVARCHAR2(64) NOT NULL ,
	PRCO_DEF_ID_ NVARCHAR2(64) DEFAULT NULL,
	NODE_ID_ NVARCHAR2(64) NOT NULL,
	NODE_NAME_ NVARCHAR2(128) DEFAULT NULL,
	START_TIME_ DATE,
	END_TIME DATE,
	IS_MULITI_TASK_ SMALLINT NOT NULL,
	PARENT_ID_ NVARCHAR2(64) DEFAULT NULL,
	PROC_INST_ID_ NVARCHAR2(64) DEFAULT NULL,
	NODE_PATH_ NVARCHAR2(1024) DEFAULT NULL,
	DEPTH_ SMALLINT DEFAULT NULL,
	TASK_TOKEN_ NVARCHAR2(255) DEFAULT NULL,
	NODE_TYPE_ NVARCHAR2(255) DEFAULT NULL,
	TARGET_NODE_ NVARCHAR2(200) DEFAULT NULL,
	TARGET_TOKEN_ NVARCHAR2(255) DEFAULT NULL,
	INTERPOSE_ SMALLINT DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	PRIMARY KEY(ID_)
);', '1', '0', NULL, '4', '1', 'id_', 'PROC_INST_ID_', NULL, '1644250277726375936', NULL, '-1');
INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644254426346016768', 'bpm_flow_mq_log', NULL, 'CREATE TABLE bpm_flow_mq_log(
	ID_ NVARCHAR2(64) NOT NULL,
	TYPE_ NVARCHAR2(40) NOT NULL,
	TITLE_ NVARCHAR2(300),
	CONTENT_ CLOB,
	STATUS_ INT NOT NULL,
	TRY_TIME_ INT,
	EXCEPTION_ NVARCHAR2(2000),
	LOG_TIME_ DATE,
	TARGET_ NVARCHAR2(64),
	PROC_INST_ID_ NVARCHAR2(64),
	TASK_ID_ NVARCHAR2(64),
	OWNER_ID_ NVARCHAR2(64),
	OWNER_NAME_ NVARCHAR2(64),
	TENANT_ID_ NVARCHAR2(64),
	YEARS_PARTITION_ INT,
	 PRIMARY KEY(ID_)
);', '1', '0', NULL, '5', '1', 'id_', 'PROC_INST_ID_', NULL, '1644250277726375936',NULL, '-1');

INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DML_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_)
VALUES('1644254843394052096', 'bpm_read_record', NULL, 'CREATE TABLE bpm_read_record(
	ID_ NVARCHAR2(255) NOT NULL,
	PROC_DEF_ID_ NVARCHAR2(255) DEFAULT NULL,
	SUP_INST_ID_ NVARCHAR2(255) DEFAULT NULL,
	PROC_INST_ID_ NVARCHAR2(255) DEFAULT NULL,
	TASK_ID_ NVARCHAR2(255) DEFAULT NULL,
	TASK_KEY_ NVARCHAR2(255) DEFAULT NULL,
	TASK_NAME_ NVARCHAR2(255) DEFAULT NULL,
	READER_ NVARCHAR2(255) DEFAULT NULL,
	READER_NAME_ NVARCHAR2(255) DEFAULT NULL,
	READ_TIME_ DATET,
	ORG_ID_ NVARCHAR2(255) DEFAULT NULL,
	ORG_PATH_ NVARCHAR2(255) DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	 PRIMARY KEY(ID_)
);', '1', '0', NULL, '6', '1', 'id_', 'PROC_INST_ID_', NULL, '1644250277726375936', NULL, '-1');
INSERT INTO BPM_DOCUMENTATION_TABLE
(ID_, TABLE_NAME_, DDL_, SYSTEM_, START_, INFO_, ORDER_, UPDATE_BY_, PARENT_FIELD_, FIELD_, TIME_KEY_, PARENT_ID_, UPDATE_TIME_, TENANT_ID_, DML_)
VALUES('1644272017298935808', 'bpm_exe_stack_executor', 'CREATE TABLE BPM_EXE_STACK_EXECUTOR (
	ID_ NVARCHAR2(64) NOT NULL PRIMARY KEY unique,
	STACK_ID_ NVARCHAR2(64) DEFAULT NULL,
	TASK_ID_ NVARCHAR2(64) DEFAULT NULL,
	ASSIGNEE_ID_ NVARCHAR2(64) DEFAULT NULL,
	CREATE_TIME_ DATE,
	END_TIME_ DATE,
	STATUS_ SMALLINT DEFAULT NULL,
	TENANT_ID_ NVARCHAR2(64) DEFAULT NULL,
	TARGET_NODE_ NVARCHAR2(64),
		 PRIMARY KEY(ID_)
);', NULL, '1', NULL, '7', '1', 'id_', 'STACK_ID_', '', '1644253067093725184', NULL, '-1', NULL);

update portal_sys_menu set tabs_style_='' where alias_='demension';

create table FORM_AUTHORIZE
(
    ID_    						NVARCHAR2(64) not null ,
    AUTHORIZE_DESC_  	NVARCHAR2(255),
    CREATE_BY_       	NVARCHAR2(64),
    CREATOR_         	NVARCHAR2(64),
    CREATE_TIME_     	DATE,
    MULTI_PLE        	NVARCHAR2(64),
    TENANT_ID_       	NVARCHAR2(64),
    AUTHORIZE_MODEL_ 	NVARCHAR2(64),
		 PRIMARY KEY(ID_)
);
comment on table FORM_AUTHORIZE is '表单模块相关授权主表';
comment on column FORM_AUTHORIZE.AUTHORIZE_DESC_ is '授权说明';
comment on column FORM_AUTHORIZE.CREATE_BY_ is '创建人ID';
comment on column FORM_AUTHORIZE.CREATOR_ is '创建人';
comment on column FORM_AUTHORIZE.AUTHORIZE_MODEL_ is '授权对象';


create table FORM_AUTHORIZE_ACT
(
  ID_    					  NVARCHAR2(64) not null,
  AUTHORIZE_ID_  	  NVARCHAR2(64),
	MODEL_KEY_				NVARCHAR2(64),
	MODEL_NAME_				NVARCHAR2(128),
	RIGHT_CONTENT_		NVARCHAR2(128),
	TYPE_							NVARCHAR2(64),
	TENANT_ID_ 				NVARCHAR2(64),
	primary key(ID_)
);
comment on table FORM_AUTHORIZE_ACT is '表单相关授权定义';
comment on column FORM_AUTHORIZE_ACT.AUTHORIZE_ID_ is '授权主表ID';
comment on column FORM_AUTHORIZE_ACT.MODEL_KEY_ is '授权KEY';
comment on column FORM_AUTHORIZE_ACT.MODEL_NAME_ is '授权名称';
comment on column FORM_AUTHORIZE_ACT.RIGHT_CONTENT_ is '授权内容';
comment on column FORM_AUTHORIZE_ACT.TYPE_ is '1,对象。2，对象分类';
create index IDX_AUTHDEF_AUTHID_ on FORM_AUTHORIZE_ACT (AUTHORIZE_ID_);

create table  FORM_AUTHORIZE_USER
(
    ID_            	NVARCHAR2(64) not null,
    AUTHORIZE_ID_  	NVARCHAR2(64),
    OWNER_NAME_    	NVARCHAR2(128),
		OWNER_ID_      	NVARCHAR2(64),
    RIGHT_TYPE_    	NVARCHAR2(20),
    OBJ_TYPE_      	NVARCHAR2(64),
    AUTH_ORG_      	NVARCHAR2(255),
    AUTH_ORG_NAME_ 	NVARCHAR2(255),
    TENANT_ID_     	NVARCHAR2(64),
		primary key(ID_)
);
comment on table  FORM_AUTHORIZE_USER is '表单相关授权的用户';
comment on column  FORM_AUTHORIZE_USER.ID_ is '流程授权主表ID';
comment on column  FORM_AUTHORIZE_USER.AUTHORIZE_ID_ is '流程授权主表ID';
comment on column  FORM_AUTHORIZE_USER.OWNER_NAME_ is '授权对象名称';
comment on column  FORM_AUTHORIZE_USER.RIGHT_TYPE_ is '授权对象类型(角色,用户,岗位等)';
comment on column  FORM_AUTHORIZE_USER.OWNER_ID_ is '授权对象ID';
create index  IDX_DEFUSER_AUTHID_ on  FORM_AUTHORIZE_USER (AUTHORIZE_ID_);
create index  IDX_DEFUSER_OBJTYPE_ on  FORM_AUTHORIZE_USER (OBJ_TYPE_);
create index  IDX_DEFUSER_RIGHTTYPE_ on  FORM_AUTHORIZE_USER (RIGHT_TYPE_);

UPDATE portal_sys_dic SET sn_ = ROWNUM WHERE sn_ IS NULL;

update portal_i18n_message set VALUE_ = '流程编号' where ID_ = '1613098875580936192';
update portal_i18n_message set VALUE_ = 'Process number' where ID_ = '1613099384089964544';
update portal_i18n_message set VALUE_ = '流程編號' where ID_ = '1613352041601921024';

-- 2023-6-25 jjx 更新维度菜单接口
UPDATE portal_sys_method SET REQUEST_URL_ = '/api/demension/v1/dem/deleteDemByIds' WHERE ALIAS_ = 'uc_demension_del';

-- 2023-6-26 liangjc 默认平台的给人事管理员和系统管理员授权
INSERT INTO portal_sys_method(id_, ALIAS_, NAME_, MENU_ALIAS_, REQUEST_URL_, PATH_, TENANT_ID_) select '1666702693495816192', 'updateUserPsw', '修改密码接口权限', ALIAS_, '/api/user/v1/user/updateUserPsw', PATH_, TENANT_ID_ from portal_sys_menu where ALIAS_='ucManager' and TENANT_ID_='-1';
INSERT INTO portal_sys_role_auth(id_, ROLE_ALIAS_, METHOD_ALIAS_, TENANT_ID_)  select '1666702693495816192', 'rsgly',  ALIAS_,  '-1' from portal_sys_method where MENU_ALIAS_='ucManager' and TENANT_ID_='-1';
INSERT INTO portal_sys_role_auth(ID_, ROLE_ALIAS_, METHOD_ALIAS_, TENANT_ID_)  select '1666702693495816193', 'xtgly',  ALIAS_,  '-1' from portal_sys_method where MENU_ALIAS_='ucManager' and TENANT_ID_='-1';

-- 2023-7-3 jjx 修改字段长度
ALTER TABLE PORTAL_SYS_TAG MODIFY KEY_ VARCHAR(128);

-- 2023-7-7 jjx 同步脚本
ALTER TABLE FORM_QUERY_SQLDEF 
ADD CREATE_BY_ NVARCHAR2(64)
ADD CREATE_TIME_ DATE
ADD CREATE_ORG_ID_ NVARCHAR2(64)
ADD UPDATE_BY_ NVARCHAR2(64)
ADD UPDATE_TIME_ DATE;

COMMENT ON COLUMN FORM_QUERY_SQLDEF.CREATE_BY_ IS '创建人ID';

COMMENT ON COLUMN FORM_QUERY_SQLDEF.CREATE_TIME_ IS '创建时间';

COMMENT ON COLUMN FORM_QUERY_SQLDEF.CREATE_ORG_ID_ IS '创建人组织ID';

COMMENT ON COLUMN FORM_QUERY_SQLDEF.UPDATE_BY_ IS '更新人ID';

COMMENT ON COLUMN FORM_QUERY_SQLDEF.UPDATE_TIME_ IS '更新时间';

ALTER TABLE FORM_CUSTOM_CHART 
ADD TYPE_ SMALLINT
ADD CUSTOM_QUERY_ALIAS_ NVARCHAR2(64);

COMMENT ON COLUMN FORM_CUSTOM_CHART.TYPE_ IS '''数据类型 1-数据源，2-关联查询''';

COMMENT ON COLUMN FORM_CUSTOM_CHART.CUSTOM_QUERY_ALIAS_ IS '关联查询别名';

-- 2023-7-20 jjx 同步脚本
CREATE TABLE PORTAL_SYS_USER_APP (
  ID_ 				NVARCHAR2(64) NOT NULL,
  TYPE_ 			NVARCHAR2(10),
  APP_ALIAS_ 	NVARCHAR2(255),
  ACCOUNT_ 		NVARCHAR2(255),
  TENANT_ID_ 	NVARCHAR2(64),
  PRIMARY KEY (ID_)
	);
COMMENT ON COLUMN PORTAL_SYS_USER_APP.TYPE_ IS '类型：PC,MOBILE';
COMMENT ON COLUMN PORTAL_SYS_USER_APP.APP_ALIAS_ IS 'APP别名';
COMMENT ON COLUMN PORTAL_SYS_USER_APP.ACCOUNT_ IS '用户ACCOUNT';
COMMENT ON TABLE PORTAL_SYS_USER_APP IS '我的应用';

	
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');	

ALTER TABLE PORTAL_SYS_APP ADD FILE_INFO_ NVARCHAR2(1000);
COMMENT ON COLUMN PORTAL_SYS_APP.FILE_INFO_ IS '应用说明';

ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD PC_BASE_URL_ NVARCHAR2(255);
COMMENT ON COLUMN PORTAL_SYS_EXTERNAL_UNITE.PC_BASE_URL_ IS '本系统PC端地址';

ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD PC_MENU_URL_ NVARCHAR2(255);
COMMENT ON COLUMN PORTAL_SYS_EXTERNAL_UNITE.PC_MENU_URL_ IS 'PC端菜单URL';

CREATE TABLE PORTAL_SYS_APP_AUTH_MENU (
  ID_ 						NVARCHAR2(64) NOT NULL,
  APP_ID_				 	NVARCHAR2(64),
  ROLE_ALIAS_ 		NVARCHAR2(64),
  MENU_ALIAS_ 		NVARCHAR2(64),
  AUTH_TYPE_ 			NVARCHAR2(32),
  TENANT_ID_ 			NVARCHAR2(64),
  PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_SYS_APP_AUTH_MENU.APP_ID_ IS '应用ID';

COMMENT ON COLUMN PORTAL_SYS_APP_AUTH_MENU.ROLE_ALIAS_ IS '角色别名';

COMMENT ON COLUMN PORTAL_SYS_APP_AUTH_MENU.MENU_ALIAS_ IS '菜单别名';

COMMENT ON COLUMN PORTAL_SYS_APP_AUTH_MENU.AUTH_TYPE_ IS '权限类型，增删改查等';

COMMENT ON TABLE PORTAL_SYS_APP_AUTH_MENU IS '应用菜单权限表';

CREATE INDEX IDX_AUTHUSER_AUTHID_PSAAM  ON PORTAL_SYS_APP_AUTH_MENU ("ROLE_ALIAS_");

CREATE INDEX IDX_MENU_ID_ ON PORTAL_SYS_APP_AUTH_MENU ("MENU_ALIAS_");

-- 2023-08-07 jjx 同步脚本
ALTER TABLE  FORM_AUTHORIZE_ACT ADD MODEL_TYPE_ NVARCHAR2(255);
COMMENT ON COLUMN  FORM_AUTHORIZE_ACT.MODEL_TYPE_ IS '授权对象类型';

ALTER TABLE  FORM_DATA_TEMPLATE ADD MOBILE_OTHER_JSON_ CLOB;
COMMENT ON COLUMN  FORM_DATA_TEMPLATE.MOBILE_OTHER_JSON_ IS '移动端扩展配置json';

-- 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');

ALTER TABLE PORTAL_NEWS_NOTICE_  ADD OPEN_TYPE_ NVARCHAR2(10);
COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.OPEN_TYPE_ IS '打开方式';

ALTER TABLE FORM_CUSTOM_DIALOG  ADD TREE_DATA_MODE_ NUMBER(5,0);
COMMENT ON COLUMN FORM_CUSTOM_DIALOG.TREE_DATA_MODE_ IS '树形数据模式  0-默认方式，加载全部数据； 1-允许选择父级；2-不允许选择父级';

ALTER TABLE PORTAL_SYS_USER_APP ADD COLUMN_ALIAS_ NVARCHAR2(100) ;
COMMENT ON COLUMN PORTAL_SYS_USER_APP.COLUMN_ALIAS_ IS '栏目别名';

-- 2023-08-25 JJX 修改系统属性中的待办列表配置
UPDATE PORTAL_SYS_PROPERTIES SET VALUE = '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' WHERE ALIAS = 'taskListFiledConf';

-- 2023-09-12 yijj 修改流转任务接收人表审批意见值为500
ALTER TABLE BPM_TRANS_RECEIVER   MODIFY ("OPINION_" NVARCHAR2(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 MODIFY TREE_DATA_MODE_ DEFAULT 0;
update form_custom_dialog set TREE_DATA_MODE_=0 where TREE_DATA_MODE_ is null;