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 *
from t_ds_udfs
- where `type` = #{type}
+ where type=#{type}
and id in (
select udf_id from t_ds_relation_udfs_user where user_id=#{userId}
diff --git a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
index b1ea9e264f..81c9706a85 100644
--- a/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
+++ b/dockerfile/conf/dolphinscheduler/conf/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
@@ -3,7 +3,7 @@
delete from t_ds_relation_user_alertgroup
- where `alertgroup_id` = #{alertgroupId}
+ where alertgroup_id = #{alertgroupId}
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 *
from t_ds_worker_group
- where `name` = #{name}
+ where name = #{name}
select *
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
index 2b2c487b4f..fa70d1e20c 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/UdfFunc.java
@@ -59,7 +59,6 @@ public class UdfFunc {
/**
* udf data base
*/
- @TableField("`database`")
private String database;
/**
diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
index 07e6f5db83..5fe5caa95a 100644
--- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
+++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
@@ -59,7 +59,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 *
from t_ds_udfs
- where `type` = #{type}
+ where type=#{type}
and id in (
select udf_id from t_ds_relation_udfs_user where user_id=#{userId}
diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
index b1ea9e264f..81c9706a85 100644
--- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
+++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/UserAlertGroupMapper.xml
@@ -3,7 +3,7 @@
delete from t_ds_relation_user_alertgroup
- where `alertgroup_id` = #{alertgroupId}
+ where alertgroup_id = #{alertgroupId}
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);
--