-- 2020-05-11 lingpj 调整流程表字段长度
ALTER TABLE BPM_EXE_STACK
MODIFY COLUMN NODE_PATH_  VARCHAR(1024) CHARACTER SET UTF8 COMMENT '节点路径';

-- 2020-05-12 qiuxd 租户类型status字段修改
ALTER TABLE UC_TENANT_TYPE
MODIFY COLUMN STATUS_ varchar(20) DEFAULT NULL COMMENT '状态：启用（enable）、禁用（disabled）';

-- 2020-05-13 lingpj 去掉菜单别名索引
ALTER TABLE PORTAL_SYS_MENU
DROP INDEX IDX_SYSMENU_ALIAS_;

-- 2020-05-13 lingpj 调整应用端布局数据
DELETE FROM PORTAL_SYS_LAYOUT_MANAGE WHERE ID = '2';
INSERT INTO PORTAL_SYS_LAYOUT_MANAGE (ID, NAME, MEMO, TEMPLATE_HTML, DESIGN_HTML, IS_DEF, LAYOUT_TYPE, ORG_ID, ORG_NAME, ENABLE, SHARE_TO_SUB, TENANT_ID_) VALUES ('2', '应用端-系统默认布局', '', '', 'eyJsaXN0IjpbeyJ0eXBlIjoiZ3JpZCIsIm5hbWUiOiLmoIXmoLzluIPlsYAiLCJpY29uIjoiaWNvbi1ncmlkIiwiY29sdW1ucyI6W3sic3BhbiI6MjQsImxpc3QiOlt7Im5hbWUiOiJ2dWXkuKrkurrkv6Hmga/moI/nm64iLCJhbGlhcyI6InZ1ZWdyeHhsbSIsIm9wdGlvbnMiOnsicmVtb3RlRnVuYyI6ImZ1bmNfMTU4ODk5MTYzODAwMF8zMTMzNSJ9LCJrZXkiOiIxNTg4OTkxNjM4MDAwXzMxMzM1IiwibW9kZWwiOiJ1bmRlZmluZWRfMTU4ODk5MTYzODAwMF8zMTMzNSIsInJ1bGVzIjpbXX1dfV0sIm9wdGlvbnMiOnsiZ3V0dGVyIjowLCJqdXN0aWZ5Ijoic3RhcnQiLCJhbGlnbiI6InRvcCIsInJlbW90ZUZ1bmMiOiJmdW5jXzE1ODg5OTE2MzMwMDBfOTMxMDIifSwia2V5IjoiMTU4ODk5MTYzMzAwMF85MzEwMiIs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xNTg4OTkxNzY3MDAwXzU2MDAwIiwibW9kZWwiOiJ1bmRlZmluZWRfMTU4ODk5MTc2NzAwMF81NjAwMCIsInJ1bGVzIjpbXX1dfV0sIm9wdGlvbnMiOnsiZ3V0dGVyIjowLCJqdXN0aWZ5Ijoic3RhcnQiLCJhbGlnbiI6InRvcCIsInJlbW90ZUZ1bmMiOiJmdW5jXzE1ODg5OTE3NjEwMDBfMTczOTkifSwia2V5IjoiMTU4ODk5MTc2MTAwMF8xNzM5OSIsIm1vZGVsIjoiZ3JpZF8xNTg4OTkxNzYxMDAwXzE3Mzk5IiwicnVsZXMiOltdfV0sImNvbmZpZyI6eyJsYWJlbFdpZHRoIjoxMDAsImxhYmVsUG9zaXRpb24iOiJyaWdodCIsInNpemUiOiJzbWFsbCJ9fQ==') WHERE ID='2';

-- 2020-05-14 amiki 修改FORM_DEFINITION中form_html字段为longtext
ALTER TABLE FORM_DEFINITION
MODIFY COLUMN FORM_HTML_  LONGTEXT CHARACTER SET UTF8;
ALTER TABLE FORM_DEFINITION_HI
MODIFY COLUMN FORM_HTML_  LONGTEXT CHARACTER SET UTF8;

-- 2020-05-15 tangxin 系统属性添加用户导入按钮显示sql
INSERT INTO PORTAL_SYS_PROPERTIES(ID, NAME, ALIAS, GROUP_, VALUE, ENCRYPT, CREATE_TIME_, DESCRIPTION, TENANT_ID_) VALUES ('20', '用户导入按钮显示', 'userExcel', null, 'false', '0', null, 'true:显示，false:不显示', '-1');

-- 2020-05-18 lingpj 添加打印模板表
CREATE TABLE FORM_PRINT_TEMPLATE
(
   ID_                  VARCHAR(64) CHARACTER SET UTF8 NOT NULL,
   FILE_ID_             VARCHAR(255) CHARACTER SET UTF8 DEFAULT NULL COMMENT '附件ID',
   FILE_NAME            VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '打印模板名称',
   FORM_KEY_            VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '表单Key',
   IS_MAIN              VARCHAR(10) CHARACTER SET UTF8 DEFAULT NULL COMMENT '是否是主版本',
   CREATE_BY_           VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '创建人ID',
   CREATE_ORG_ID_       VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '创建者所属组织ID',
   CREATE_TIME_         DATETIME DEFAULT NULL COMMENT '创建时间',
   UPDATE_BY_           VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '更新人ID',
   UPDATE_TIME_         DATETIME DEFAULT NULL COMMENT '更新时间',
   TENANT_ID_           VARCHAR(64) CHARACTER SET UTF8 DEFAULT NULL COMMENT '租户id',
   PRIMARY KEY (ID_)
)
ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI COMMENT = '打印模板' ROW_FORMAT = COMPACT;

-- 2020-05-18 wanghb 将IDX_FORM_BO_DEF表的别名索引改为别名+租户id联合索引
ALTER TABLE FORM_BO_DEF
DROP INDEX IDX_FORM_BO_DEF_ALIAS;
CREATE UNIQUE INDEX IDX_FORM_BO_DEF_ALIAS ON FORM_BO_DEF (ALIAS_,TENANT_ID_);

-- 2020-05-19 zhaoxiangyun 在初始化语句中加入添催办定时计划的配置
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.TaskReminderJob', '1', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);
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.FlowAutoStartJob', '1', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);

-- 2020-05-19 lingpj 调整url字段长度
ALTER TABLE FORM_CUSTOM_QUERY 
MODIFY COLUMN URL_ varchar(1000) CHARACTER SET utf8;

-- 2020-5-22 yangxb form_definition表增加expend字段
ALTER TABLE FORM_DEFINITION ADD COLUMN EXPAND_ LONGTEXT NULL COMMENT '扩展字段';

-- 2020-05-20 yangxb 调整表单设计打开模块
UPDATE PORTAL_SYS_MENU SET ACTIVE_TAB_ = 'businessObj' WHERE ID_ = '3391046'