From f1838570ede37a5599c16f54071bae4f36cf1252 Mon Sep 17 00:00:00 2001 From: bao liang <29528966+lenboo@users.noreply.github.com> Date: Wed, 30 Oct 2019 18:50:38 +0800 Subject: [PATCH] fix some bugs about postgre. (#1129) * update english documents * refactor zk client * update documents * update zkclient * update zkclient * update documents * add architecture-design * change i18n * update i18n * update english documents * add architecture-design * update english documents * update en-US documents * add architecture-design * update demo site * add mybatis plus model * modify mybatisplus * modify mybatisplus * change interface by mybatisplus * add unit test * refactor dao interface. * add unit test for dao... * add unit test for dao... * add unit test for dao... * Merge remote-tracking branch 'upstream/dev-db' into dev-db # Conflicts: # dolphinscheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProjectMapper.xml # dolphinscheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ScheduleMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProcessInstanceMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProjectUserMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/QueueMapper.xml # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ProcessInstanceMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ProjectUserMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/QueueMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ResourceUserMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ScheduleMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/SessionMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/TenantMapperTest.java * Merge remote-tracking branch 'upstream/dev-db' into dev-db # Conflicts: # dolphinscheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProjectMapper.xml # dolphinscheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ScheduleMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProcessInstanceMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/ProjectUserMapper.xml # escheduler-dao/src/main/resources/cn.escheduler.dao.mapper/QueueMapper.xml # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ProcessInstanceMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ProjectUserMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/QueueMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ResourceUserMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/ScheduleMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/SessionMapperTest.java # escheduler-dao/src/test/java/cn/escheduler/dao/mapper/TenantMapperTest.java * Merge remote-tracking branch 'upstream/dev-db' into dev-db # Conflicts: # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml * update some dao bugs * update for some bugs * update some bugs * Merge remote-tracking branch 'upstream/dev-db' into dev-db # Conflicts: # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml # dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml * update * update * add multiply settings for application.yml * add multiply settings for application.yml * revert * update configuration settings in task record dao... * change application_master to application-master * change application_master to application-master * update application.yml to application.properties * revert * revert * add properties * add properties * revert * revert * add api start up.. add alert send try catch * update dao info level * fix bug: task cannot submit when recovery failover * fix bug: task cannot submit when recovery failover * merge from dev-db * revert * revert * fix bug: get process definition list failed. * fix bug: process instance interval is error * revert * revert * update * support stop submit success tasks * update kill process * update for stop process * update for stop process * add some logs for stop process * update for small bug. * add check strategy before submit task * revert * update * update * revert * wait task instance exists if null. * revert * update * change desc to description. * add check user and definitions function when delete tenant * update * change desc to description. * change desc to description. * change desc to description. * remove check resources when delete tenant * change desc to description. * change mybatisplus version to 3.2.0 * update * change the notice to apache. * update * update postgre sql * fix bug: phone can be empty. * fix bug: postgre test error. * update create table for postgre quartz * fix some bugs about postgre. * update create table for postgre quartz --- .../dao/mapper/UDFUserMapper.xml | 4 +- .../dao/mapper/UdfFuncMapper.xml | 4 +- .../dao/mapper/UserAlertGroupMapper.xml | 2 +- .../dao/mapper/WorkerGroupMapper.xml | 2 +- .../dolphinscheduler/dao/entity/UdfFunc.java | 1 - .../dao/mapper/ProcessDefinitionMapper.xml | 2 +- .../dao/mapper/UDFUserMapper.xml | 4 +- .../dao/mapper/UdfFuncMapper.xml | 4 +- .../dao/mapper/UserAlertGroupMapper.xml | 2 +- install.sh | 1 + .../postgresql/dolphinscheduler_ddl.sql | 326 +++++++----------- 11 files changed, 144 insertions(+), 208 deletions(-) diff --git a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml index caa2a910ed..afa35945ea 100644 --- a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml +++ b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml @@ -3,10 +3,10 @@ delete from t_ds_relation_udfs_user - where `user_id` = #{userId} + where user_id=#{userId} delete from t_ds_relation_udfs_user - where `udf_id` = #{udfFuncId} + where udf_id=#{udfFuncId} \ No newline at end of file diff --git a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml index db63fe98f0..0fb496f4a4 100644 --- a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml +++ b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml @@ -21,7 +21,7 @@ from t_ds_udfs where 1=1 - and `name` like concat('%', #{searchVal}, '%') + and name like concat('%', #{searchVal}, '%') and id in ( @@ -33,7 +33,7 @@ SELECT u.* diff --git a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapper.xml b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapper.xml index 1ff7c0742e..1a21d0897f 100644 --- a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapper.xml +++ b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapper.xml @@ -9,7 +9,7 @@ SELECT pd.*, u.user_name, - p.`name` AS project_name + p.name AS project_name FROM t_ds_process_definition pd, t_ds_user u, diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml index caa2a910ed..c426410551 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UDFUserMapper.xml @@ -3,10 +3,10 @@ delete from t_ds_relation_udfs_user - where `user_id` = #{userId} + where user_id = #{userId} delete from t_ds_relation_udfs_user - where `udf_id` = #{udfFuncId} + where udf_id = #{udfFuncId} \ No newline at end of file diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml index 80e7c87d73..cf89023caa 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UdfFuncMapper.xml @@ -21,7 +21,7 @@ from t_ds_udfs where 1=1 - and `name` like concat('%', #{searchVal}, '%') + and func_name like concat('%', #{searchVal}, '%') and id in ( @@ -33,7 +33,7 @@ SELECT u.* diff --git a/install.sh b/install.sh index 78ad6123fd..4477cf4926 100644 --- a/install.sh +++ b/install.sh @@ -323,6 +323,7 @@ if [ $dbtype == "postgresql" ];then sed -i ${txt} "s#org.quartz.dataSource.myDs.user.*#org.quartz.dataSource.myDs.user=${username}#g" conf/quartz.properties sed -i ${txt} "s#org.quartz.dataSource.myDs.password.*#org.quartz.dataSource.myDs.password=${passowrd}#g" conf/quartz.properties sed -i ${txt} "s#org.quartz.dataSource.myDs.driver.*#org.quartz.dataSource.myDs.driver=org.postgresql.Driver#g" conf/quartz.properties + sed -i ${txt} "s#org.quartz.jobStore.driverDelegateClass.*#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate#g" conf/quartz.properties fi diff --git a/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql b/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql index c130422c14..8b1698edb8 100644 --- a/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -1,214 +1,150 @@ -DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; -CREATE TABLE QRTZ_BLOB_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - BLOB_DATA bytea NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- --- Table structure for table QRTZ_CALENDARS --- - -DROP TABLE IF EXISTS QRTZ_CALENDARS; -CREATE TABLE QRTZ_CALENDARS ( - SCHED_NAME varchar(120) NOT NULL, - CALENDAR_NAME varchar(200) NOT NULL, - CALENDAR bytea NOT NULL, - PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) -); --- --- Table structure for table QRTZ_CRON_TRIGGERS --- - -DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; -CREATE TABLE QRTZ_CRON_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - CRON_EXPRESSION varchar(120) NOT NULL, - TIME_ZONE_ID varchar(80) DEFAULT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- --- Table structure for table QRTZ_FIRED_TRIGGERS --- - DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS; -CREATE TABLE QRTZ_FIRED_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - ENTRY_ID varchar(95) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - INSTANCE_NAME varchar(200) NOT NULL, - FIRED_TIME bigint NOT NULL, - SCHED_TIME bigint NOT NULL, - PRIORITY int NOT NULL, - STATE varchar(16) NOT NULL, - JOB_NAME varchar(200) DEFAULT NULL, - JOB_GROUP varchar(200) DEFAULT NULL, - IS_NONCONCURRENT varchar(1) DEFAULT NULL, - REQUESTS_RECOVERY varchar(1) DEFAULT NULL, - PRIMARY KEY (SCHED_NAME,ENTRY_ID) -) ; - create index IDX_QRTZ_FT_TRIG_INST_NAME on QRTZ_FIRED_TRIGGERS (SCHED_NAME,INSTANCE_NAME); - create index IDX_QRTZ_FT_INST_JOB_REQ_RCVRY on QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); - create index IDX_QRTZ_FT_J_G on QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); - create index IDX_QRTZ_FT_JG on QRTZ_FIRED_TRIGGERS (SCHED_NAME,JOB_GROUP); - create index IDX_QRTZ_FT_T_G on QRTZ_FIRED_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); - create index IDX_QRTZ_FT_TG on QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); - --- --- Table structure for table QRTZ_LOCKS --- - -DROP TABLE IF EXISTS QRTZ_LOCKS; -CREATE TABLE QRTZ_LOCKS ( - SCHED_NAME varchar(120) NOT NULL, - LOCK_NAME varchar(40) NOT NULL, - PRIMARY KEY (SCHED_NAME,LOCK_NAME) -) ; - --- --- Table structure for table QRTZ_PAUSED_TRIGGER_GRPS --- - DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS; -CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) -) ; - --- --- Table structure for table QRTZ_SCHEDULER_STATE --- - DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE; -CREATE TABLE QRTZ_SCHEDULER_STATE ( - SCHED_NAME varchar(120) NOT NULL, - INSTANCE_NAME varchar(200) NOT NULL, - LAST_CHECKIN_TIME bigint NOT NULL, - CHECKIN_INTERVAL bigint NOT NULL, - PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) -) ; - --- --- Table structure for table QRTZ_SIMPLE_TRIGGERS --- - +DROP TABLE IF EXISTS QRTZ_LOCKS; DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS; -CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - REPEAT_COUNT bigint NOT NULL, - REPEAT_INTERVAL bigint NOT NULL, - TIMES_TRIGGERED bigint NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - -) ; - --- --- Table structure for table QRTZ_SIMPROP_TRIGGERS --- - DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS; -CREATE TABLE QRTZ_SIMPROP_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - STR_PROP_1 varchar(512) DEFAULT NULL, - STR_PROP_2 varchar(512) DEFAULT NULL, - STR_PROP_3 varchar(512) DEFAULT NULL, - INT_PROP_1 int DEFAULT NULL, - INT_PROP_2 int DEFAULT NULL, - LONG_PROP_1 bigint DEFAULT NULL, - LONG_PROP_2 bigint DEFAULT NULL, - DEC_PROP_1 decimal(13,4) DEFAULT NULL, - DEC_PROP_2 decimal(13,4) DEFAULT NULL, - BOOL_PROP_1 varchar(1) DEFAULT NULL, - BOOL_PROP_2 varchar(1) DEFAULT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; - --- --- Table structure for table QRTZ_TRIGGERS --- - +DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; +DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; DROP TABLE IF EXISTS QRTZ_TRIGGERS; -CREATE TABLE QRTZ_TRIGGERS ( - SCHED_NAME varchar(120) NOT NULL, - TRIGGER_NAME varchar(200) NOT NULL, - TRIGGER_GROUP varchar(200) NOT NULL, - JOB_NAME varchar(200) NOT NULL, - JOB_GROUP varchar(200) NOT NULL, - DESCRIPTION varchar(250) DEFAULT NULL, - NEXT_FIRE_TIME bigint DEFAULT NULL, - PREV_FIRE_TIME bigint DEFAULT NULL, - PRIORITY int DEFAULT NULL, - TRIGGER_STATE varchar(16) NOT NULL, - TRIGGER_TYPE varchar(8) NOT NULL, - START_TIME bigint NOT NULL, - END_TIME bigint DEFAULT NULL, - CALENDAR_NAME varchar(200) DEFAULT NULL, - MISFIRE_INSTR smallint DEFAULT NULL, - JOB_DATA bytea, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; +DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; +DROP TABLE IF EXISTS QRTZ_CALENDARS; - create index IDX_QRTZ_T_J on QRTZ_TRIGGERS (SCHED_NAME,JOB_NAME,JOB_GROUP); - create index IDX_QRTZ_T_JG on QRTZ_TRIGGERS (SCHED_NAME,JOB_GROUP); - create index IDX_QRTZ_T_C on QRTZ_TRIGGERS (SCHED_NAME,CALENDAR_NAME); - create index IDX_QRTZ_T_G on QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_GROUP); - create index IDX_QRTZ_T_STATE on QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_STATE); - create index IDX_QRTZ_T_N_STATE on QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); - create index IDX_QRTZ_T_N_G_STATE on QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); - create index IDX_QRTZ_T_NEXT_FIRE_TIME on QRTZ_TRIGGERS (SCHED_NAME,NEXT_FIRE_TIME); - create index IDX_QRTZ_T_NFT_ST on QRTZ_TRIGGERS (SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); - create index IDX_QRTZ_T_NFT_MISFIRE on QRTZ_TRIGGERS (SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); - create index IDX_QRTZ_T_NFT_ST_MISFIRE on QRTZ_TRIGGERS (SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); - create index IDX_QRTZ_T_NFT_ST_MISFIRE_GRP on QRTZ_TRIGGERS (SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); +CREATE TABLE QRTZ_JOB_DETAILS( +SCHED_NAME character varying(120) NOT NULL, +JOB_NAME character varying(200) NOT NULL, +JOB_GROUP character varying(200) NOT NULL, +DESCRIPTION character varying(250) NULL, +JOB_CLASS_NAME character varying(250) NOT NULL, +IS_DURABLE boolean NOT NULL, +IS_NONCONCURRENT boolean NOT NULL, +IS_UPDATE_DATA boolean NOT NULL, +REQUESTS_RECOVERY boolean NOT NULL, +JOB_DATA bytea NULL); +alter table QRTZ_JOB_DETAILS add primary key(SCHED_NAME,JOB_NAME,JOB_GROUP); +CREATE TABLE QRTZ_TRIGGERS ( +SCHED_NAME character varying(120) NOT NULL, +TRIGGER_NAME character varying(200) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL, +JOB_NAME character varying(200) NOT NULL, +JOB_GROUP character varying(200) NOT NULL, +DESCRIPTION character varying(250) NULL, +NEXT_FIRE_TIME BIGINT NULL, +PREV_FIRE_TIME BIGINT NULL, +PRIORITY INTEGER NULL, +TRIGGER_STATE character varying(16) NOT NULL, +TRIGGER_TYPE character varying(8) NOT NULL, +START_TIME BIGINT NOT NULL, +END_TIME BIGINT NULL, +CALENDAR_NAME character varying(200) NULL, +MISFIRE_INSTR SMALLINT NULL, +JOB_DATA bytea NULL) ; +alter table QRTZ_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); --- --- Table structure for table QRTZ_JOB_DETAILS --- +CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( +SCHED_NAME character varying(120) NOT NULL, +TRIGGER_NAME character varying(200) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL, +REPEAT_COUNT BIGINT NOT NULL, +REPEAT_INTERVAL BIGINT NOT NULL, +TIMES_TRIGGERED BIGINT NOT NULL) ; +alter table QRTZ_SIMPLE_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; -CREATE TABLE QRTZ_JOB_DETAILS ( - SCHED_NAME varchar(120) NOT NULL, - JOB_NAME varchar(200) NOT NULL, - JOB_GROUP varchar(200) NOT NULL, - DESCRIPTION varchar(250) DEFAULT NULL, - JOB_CLASS_NAME varchar(250) NOT NULL, - IS_DURABLE varchar(1) NOT NULL, - IS_NONCONCURRENT varchar(1) NOT NULL, - IS_UPDATE_DATA varchar(1) NOT NULL, - REQUESTS_RECOVERY varchar(1) NOT NULL, - JOB_DATA bytea, - PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -) ; - create index IDX_QRTZ_J_REQ_RECOVERY on QRTZ_JOB_DETAILS (SCHED_NAME,REQUESTS_RECOVERY); - create index IDX_QRTZ_J_GRP on QRTZ_JOB_DETAILS (SCHED_NAME,JOB_GROUP); +CREATE TABLE QRTZ_CRON_TRIGGERS ( +SCHED_NAME character varying(120) NOT NULL, +TRIGGER_NAME character varying(200) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL, +CRON_EXPRESSION character varying(120) NOT NULL, +TIME_ZONE_ID character varying(80)) ; +alter table QRTZ_CRON_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); + +CREATE TABLE QRTZ_SIMPROP_TRIGGERS + ( + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + STR_PROP_1 character varying(512) NULL, + STR_PROP_2 character varying(512) NULL, + STR_PROP_3 character varying(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 boolean NULL, + BOOL_PROP_2 boolean NULL) ; +alter table QRTZ_SIMPROP_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -alter table QRTZ_BLOB_TRIGGERS drop CONSTRAINT if EXISTS QRTZ_BLOB_TRIGGERS_ibfk_1; -alter table QRTZ_BLOB_TRIGGERS add CONSTRAINT QRTZ_BLOB_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP); +CREATE TABLE QRTZ_BLOB_TRIGGERS ( +SCHED_NAME character varying(120) NOT NULL, +TRIGGER_NAME character varying(200) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL, +BLOB_DATA bytea NULL) ; +alter table QRTZ_BLOB_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -alter table QRTZ_CRON_TRIGGERS drop CONSTRAINT if EXISTS QRTZ_CRON_TRIGGERS_ibfk_1; -alter table QRTZ_CRON_TRIGGERS add CONSTRAINT QRTZ_CRON_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP); +CREATE TABLE QRTZ_CALENDARS ( +SCHED_NAME character varying(120) NOT NULL, +CALENDAR_NAME character varying(200) NOT NULL, +CALENDAR bytea NOT NULL) ; +alter table QRTZ_CALENDARS add primary key(SCHED_NAME,CALENDAR_NAME); -alter table QRTZ_SIMPLE_TRIGGERS drop CONSTRAINT if EXISTS QRTZ_SIMPLE_TRIGGERS_ibfk_1; -alter table QRTZ_SIMPLE_TRIGGERS add CONSTRAINT QRTZ_SIMPLE_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP); +CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( +SCHED_NAME character varying(120) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL) ; +alter table QRTZ_PAUSED_TRIGGER_GRPS add primary key(SCHED_NAME,TRIGGER_GROUP); -alter table QRTZ_SIMPROP_TRIGGERS drop CONSTRAINT if EXISTS QRTZ_SIMPROP_TRIGGERS_ibfk_1; -alter table QRTZ_SIMPROP_TRIGGERS add CONSTRAINT QRTZ_SIMPROP_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP); +CREATE TABLE QRTZ_FIRED_TRIGGERS ( +SCHED_NAME character varying(120) NOT NULL, +ENTRY_ID character varying(95) NOT NULL, +TRIGGER_NAME character varying(200) NOT NULL, +TRIGGER_GROUP character varying(200) NOT NULL, +INSTANCE_NAME character varying(200) NOT NULL, +FIRED_TIME BIGINT NOT NULL, +SCHED_TIME BIGINT NOT NULL, +PRIORITY INTEGER NOT NULL, +STATE character varying(16) NOT NULL, +JOB_NAME character varying(200) NULL, +JOB_GROUP character varying(200) NULL, +IS_NONCONCURRENT boolean NULL, +REQUESTS_RECOVERY boolean NULL) ; +alter table QRTZ_FIRED_TRIGGERS add primary key(SCHED_NAME,ENTRY_ID); -alter table QRTZ_TRIGGERS drop CONSTRAINT if EXISTS QRTZ_TRIGGERS_ibfk_1; -alter table QRTZ_TRIGGERS add CONSTRAINT QRTZ_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, JOB_NAME, JOB_GROUP) REFERENCES QRTZ_JOB_DETAILS (SCHED_NAME, JOB_NAME, JOB_GROUP); +CREATE TABLE QRTZ_SCHEDULER_STATE ( +SCHED_NAME character varying(120) NOT NULL, +INSTANCE_NAME character varying(200) NOT NULL, +LAST_CHECKIN_TIME BIGINT NOT NULL, +CHECKIN_INTERVAL BIGINT NOT NULL) ; +alter table QRTZ_SCHEDULER_STATE add primary key(SCHED_NAME,INSTANCE_NAME); +CREATE TABLE QRTZ_LOCKS ( +SCHED_NAME character varying(120) NOT NULL, +LOCK_NAME character varying(40) NOT NULL) ; +alter table QRTZ_LOCKS add primary key(SCHED_NAME,LOCK_NAME); + +CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY); +CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP); + +CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME); +CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); +CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME); +CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP); +CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); --