quartz切换使用PostgreSQL数据库

一、首先需要改下面三个表:

CREATE TABLE qrtz_fired_triggers (
"sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
"entry_id" varchar(95) COLLATE "pg_catalog"."default" NOT NULL,
"trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"instance_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"fired_time" numeric(20,0) NOT NULL,
"sched_time" numeric(20,0) NOT NULL,
"priority" numeric(11,0) NOT NULL,
"state" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
"job_name" varchar(200) COLLATE "pg_catalog"."default",
"job_group" varchar(200) COLLATE "pg_catalog"."default",
"is_nonconcurrent" bool,
"requests_recovery" bool
)
;

is_nonconcurrent和requests_recovery字段由varchar(1)改为bool类型;
CREATE TABLE qrtz_job_details (
"sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
"job_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"job_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"description" varchar(250) COLLATE "pg_catalog"."default",
"job_class_name" varchar(250) COLLATE "pg_catalog"."default" NOT NULL,
"is_durable" bool NOT NULL,
"is_nonconcurrent" bool NOT NULL,
"is_update_data" bool NOT NULL,
"requests_recovery" bool NOT NULL,
"job_data" bytea
)
;

is_durable、is_nonconcurrent、is_update_data和requests_recovery字段由varchar(1)改为bool类型;
CREATE TABLE qrtz_simprop_triggers (
"sched_name" varchar(120) COLLATE "pg_catalog"."default" NOT NULL,
"trigger_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"trigger_group" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
"str_prop_1" varchar(512) COLLATE "pg_catalog"."default",
"str_prop_2" varchar(512) COLLATE "pg_catalog"."default",
"str_prop_3" varchar(512) COLLATE "pg_catalog"."default",
"int_prop_1" numeric(11,0),
"int_prop_2" numeric(11,0),
"long_prop_1" numeric(20,0),
"long_prop_2" numeric(20,0),
"dec_prop_1" numeric(1000,0),
"dec_prop_2" numeric(1000,0),
"bool_prop_1" bool,
"bool_prop_2" bool
)
;

bool_prop_1和bool_prop_2字段由varchar(1)改为bool类型;

二、然后在quartz.properties文件修改或添加下面配置项:

org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate

你可能感兴趣的:(workStudy,数据库,postgresql,sqlserver)