正在显示
1 个修改的文件
包含
121 行增加
和
117 行删除
| 1 | +DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS; | ||
| 2 | +DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS; | ||
| 3 | +DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE; | ||
| 4 | +DROP TABLE IF EXISTS QRTZ_LOCKS; | ||
| 5 | +DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS; | ||
| 6 | +DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS; | ||
| 7 | +DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; | ||
| 8 | +DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; | ||
| 9 | +DROP TABLE IF EXISTS QRTZ_TRIGGERS; | ||
| 10 | +DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; | ||
| 11 | +DROP TABLE IF EXISTS QRTZ_CALENDARS; | ||
| 12 | + | ||
| 1 | -- ---------------------------- | 13 | -- ---------------------------- |
| 2 | -- 1、存储每一个已配置的 jobDetail 的详细信息 | 14 | -- 1、存储每一个已配置的 jobDetail 的详细信息 |
| 3 | -- ---------------------------- | 15 | -- ---------------------------- |
| 4 | -drop table if exists QRTZ_JOB_DETAILS; | ||
| 5 | create table QRTZ_JOB_DETAILS ( | 16 | create table QRTZ_JOB_DETAILS ( |
| 6 | - sched_name varchar(120) not null, | ||
| 7 | - job_name varchar(200) not null, | ||
| 8 | - job_group varchar(200) not null, | ||
| 9 | - description varchar(250) null, | ||
| 10 | - job_class_name varchar(250) not null, | ||
| 11 | - is_durable varchar(1) not null, | ||
| 12 | - is_nonconcurrent varchar(1) not null, | ||
| 13 | - is_update_data varchar(1) not null, | ||
| 14 | - requests_recovery varchar(1) not null, | ||
| 15 | - job_data blob null, | ||
| 16 | - primary key (sched_name,job_name,job_group) | ||
| 17 | -) engine=innodb; | 17 | + sched_name varchar(120) not null comment '调度名称', |
| 18 | + job_name varchar(200) not null comment '任务名称', | ||
| 19 | + job_group varchar(200) not null comment '任务组名', | ||
| 20 | + description varchar(250) null comment '相关介绍', | ||
| 21 | + job_class_name varchar(250) not null comment '执行任务类名称', | ||
| 22 | + is_durable varchar(1) not null comment '是否持久化', | ||
| 23 | + is_nonconcurrent varchar(1) not null comment '是否并发', | ||
| 24 | + is_update_data varchar(1) not null comment '是否更新数据', | ||
| 25 | + requests_recovery varchar(1) not null comment '是否接受恢复执行', | ||
| 26 | + job_data blob null comment '存放持久化job对象', | ||
| 27 | + primary key (sched_name, job_name, job_group) | ||
| 28 | +) engine=innodb comment = '任务详细信息表'; | ||
| 18 | 29 | ||
| 19 | -- ---------------------------- | 30 | -- ---------------------------- |
| 20 | -- 2、 存储已配置的 Trigger 的信息 | 31 | -- 2、 存储已配置的 Trigger 的信息 |
| 21 | -- ---------------------------- | 32 | -- ---------------------------- |
| 22 | -drop table if exists QRTZ_TRIGGERS; | ||
| 23 | create table QRTZ_TRIGGERS ( | 33 | create table QRTZ_TRIGGERS ( |
| 24 | - sched_name varchar(120) not null, | ||
| 25 | - trigger_name varchar(200) not null, | ||
| 26 | - trigger_group varchar(200) not null, | ||
| 27 | - job_name varchar(200) not null, | ||
| 28 | - job_group varchar(200) not null, | ||
| 29 | - description varchar(250) null, | ||
| 30 | - next_fire_time bigint(13) null, | ||
| 31 | - prev_fire_time bigint(13) null, | ||
| 32 | - priority integer null, | ||
| 33 | - trigger_state varchar(16) not null, | ||
| 34 | - trigger_type varchar(8) not null, | ||
| 35 | - start_time bigint(13) not null, | ||
| 36 | - end_time bigint(13) null, | ||
| 37 | - calendar_name varchar(200) null, | ||
| 38 | - misfire_instr smallint(2) null, | ||
| 39 | - job_data blob null, | ||
| 40 | - primary key (sched_name,trigger_name,trigger_group), | ||
| 41 | - foreign key (sched_name,job_name,job_group) references QRTZ_JOB_DETAILS(sched_name,job_name,job_group) | ||
| 42 | -) engine=innodb; | 34 | + sched_name varchar(120) not null comment '调度名称', |
| 35 | + trigger_name varchar(200) not null comment '触发器的名字', | ||
| 36 | + trigger_group varchar(200) not null comment '触发器所属组的名字', | ||
| 37 | + job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键', | ||
| 38 | + job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键', | ||
| 39 | + description varchar(250) null comment '相关介绍', | ||
| 40 | + next_fire_time bigint(13) null comment '上一次触发时间(毫秒)', | ||
| 41 | + prev_fire_time bigint(13) null comment '下一次触发时间(默认为-1表示不触发)', | ||
| 42 | + priority integer null comment '优先级', | ||
| 43 | + trigger_state varchar(16) not null comment '触发器状态', | ||
| 44 | + trigger_type varchar(8) not null comment '触发器的类型', | ||
| 45 | + start_time bigint(13) not null comment '开始时间', | ||
| 46 | + end_time bigint(13) null comment '结束时间', | ||
| 47 | + calendar_name varchar(200) null comment '日程表名称', | ||
| 48 | + misfire_instr smallint(2) null comment '补偿执行的策略', | ||
| 49 | + job_data blob null comment '存放持久化job对象', | ||
| 50 | + primary key (sched_name, trigger_name, trigger_group), | ||
| 51 | + foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group) | ||
| 52 | +) engine=innodb comment = '触发器详细信息表'; | ||
| 43 | 53 | ||
| 44 | -- ---------------------------- | 54 | -- ---------------------------- |
| 45 | -- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数 | 55 | -- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数 |
| 46 | -- ---------------------------- | 56 | -- ---------------------------- |
| 47 | -drop table if exists QRTZ_SIMPLE_TRIGGERS; | ||
| 48 | create table QRTZ_SIMPLE_TRIGGERS ( | 57 | create table QRTZ_SIMPLE_TRIGGERS ( |
| 49 | - sched_name varchar(120) not null, | ||
| 50 | - trigger_name varchar(200) not null, | ||
| 51 | - trigger_group varchar(200) not null, | ||
| 52 | - repeat_count bigint(7) not null, | ||
| 53 | - repeat_interval bigint(12) not null, | ||
| 54 | - times_triggered bigint(10) not null, | ||
| 55 | - primary key (sched_name,trigger_name,trigger_group), | ||
| 56 | - foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) | ||
| 57 | -) engine=innodb; | 58 | + sched_name varchar(120) not null comment '调度名称', |
| 59 | + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_ name的外键', | ||
| 60 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 61 | + repeat_count bigint(7) not null comment '重复的次数统计', | ||
| 62 | + repeat_interval bigint(12) not null comment '重复的间隔时间', | ||
| 63 | + times_triggered bigint(10) not null comment '已经触发的次数', | ||
| 64 | + primary key (sched_name, trigger_name, trigger_group), | ||
| 65 | + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) | ||
| 66 | +) engine=innodb comment = '简单触发器的信息表'; | ||
| 58 | 67 | ||
| 59 | -- ---------------------------- | 68 | -- ---------------------------- |
| 60 | -- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息 | 69 | -- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息 |
| 61 | -- ---------------------------- | 70 | -- ---------------------------- |
| 62 | -drop table if exists QRTZ_CRON_TRIGGERS; | ||
| 63 | create table QRTZ_CRON_TRIGGERS ( | 71 | create table QRTZ_CRON_TRIGGERS ( |
| 64 | - sched_name varchar(120) not null, | ||
| 65 | - trigger_name varchar(200) not null, | ||
| 66 | - trigger_group varchar(200) not null, | ||
| 67 | - cron_expression varchar(200) not null, | ||
| 68 | - time_zone_id varchar(80), | ||
| 69 | - primary key (sched_name,trigger_name,trigger_group), | ||
| 70 | - foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) | ||
| 71 | -) engine=innodb; | 72 | + sched_name varchar(120) not null comment '调度名称', |
| 73 | + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', | ||
| 74 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 75 | + cron_expression varchar(200) not null comment 'cron表达式', | ||
| 76 | + time_zone_id varchar(80) comment '时区', | ||
| 77 | + primary key (sched_name, trigger_name, trigger_group), | ||
| 78 | + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) | ||
| 79 | +) engine=innodb comment = 'Cron类型的触发器表'; | ||
| 72 | 80 | ||
| 73 | -- ---------------------------- | 81 | -- ---------------------------- |
| 74 | -- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候) | 82 | -- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候) |
| 75 | -- ---------------------------- | 83 | -- ---------------------------- |
| 76 | -drop table if exists QRTZ_BLOB_TRIGGERS; | ||
| 77 | create table QRTZ_BLOB_TRIGGERS ( | 84 | create table QRTZ_BLOB_TRIGGERS ( |
| 78 | - sched_name varchar(120) not null, | ||
| 79 | - trigger_name varchar(200) not null, | ||
| 80 | - trigger_group varchar(200) not null, | ||
| 81 | - blob_data blob null, | ||
| 82 | - primary key (sched_name,trigger_name,trigger_group), | ||
| 83 | - foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) | ||
| 84 | -) engine=innodb; | 85 | + sched_name varchar(120) not null comment '调度名称', |
| 86 | + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', | ||
| 87 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 88 | + blob_data blob null comment '存放持久化Trigger对象', | ||
| 89 | + primary key (sched_name, trigger_name, trigger_group), | ||
| 90 | + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) | ||
| 91 | +) engine=innodb comment = 'Blob类型的触发器表'; | ||
| 85 | 92 | ||
| 86 | -- ---------------------------- | 93 | -- ---------------------------- |
| 87 | -- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围 | 94 | -- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围 |
| 88 | -- ---------------------------- | 95 | -- ---------------------------- |
| 89 | -drop table if exists QRTZ_CALENDARS; | ||
| 90 | create table QRTZ_CALENDARS ( | 96 | create table QRTZ_CALENDARS ( |
| 91 | - sched_name varchar(120) not null, | ||
| 92 | - calendar_name varchar(200) not null, | ||
| 93 | - calendar blob not null, | ||
| 94 | - primary key (sched_name,calendar_name) | ||
| 95 | -) engine=innodb; | 97 | + sched_name varchar(120) not null comment '调度名称', |
| 98 | + calendar_name varchar(200) not null comment '日历名称', | ||
| 99 | + calendar blob not null comment '存放持久化calendar对象', | ||
| 100 | + primary key (sched_name, calendar_name) | ||
| 101 | +) engine=innodb comment = '日历信息表'; | ||
| 96 | 102 | ||
| 97 | -- ---------------------------- | 103 | -- ---------------------------- |
| 98 | -- 7、 存储已暂停的 Trigger 组的信息 | 104 | -- 7、 存储已暂停的 Trigger 组的信息 |
| 99 | -- ---------------------------- | 105 | -- ---------------------------- |
| 100 | -drop table if exists QRTZ_PAUSED_TRIGGER_GRPS; | ||
| 101 | create table QRTZ_PAUSED_TRIGGER_GRPS ( | 106 | create table QRTZ_PAUSED_TRIGGER_GRPS ( |
| 102 | - sched_name varchar(120) not null, | ||
| 103 | - trigger_group varchar(200) not null, | ||
| 104 | - primary key (sched_name,trigger_group) | ||
| 105 | -) engine=innodb; | 107 | + sched_name varchar(120) not null comment '调度名称', |
| 108 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 109 | + primary key (sched_name, trigger_group) | ||
| 110 | +) engine=innodb comment = '暂停的触发器表'; | ||
| 106 | 111 | ||
| 107 | -- ---------------------------- | 112 | -- ---------------------------- |
| 108 | -- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息 | 113 | -- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息 |
| 109 | -- ---------------------------- | 114 | -- ---------------------------- |
| 110 | -drop table if exists QRTZ_FIRED_TRIGGERS; | ||
| 111 | create table QRTZ_FIRED_TRIGGERS ( | 115 | create table QRTZ_FIRED_TRIGGERS ( |
| 112 | - sched_name varchar(120) not null, | ||
| 113 | - entry_id varchar(95) not null, | ||
| 114 | - trigger_name varchar(200) not null, | ||
| 115 | - trigger_group varchar(200) not null, | ||
| 116 | - instance_name varchar(200) not null, | ||
| 117 | - fired_time bigint(13) not null, | ||
| 118 | - sched_time bigint(13) not null, | ||
| 119 | - priority integer not null, | ||
| 120 | - state varchar(16) not null, | ||
| 121 | - job_name varchar(200) null, | ||
| 122 | - job_group varchar(200) null, | ||
| 123 | - is_nonconcurrent varchar(1) null, | ||
| 124 | - requests_recovery varchar(1) null, | ||
| 125 | - primary key (sched_name,entry_id) | ||
| 126 | -) engine=innodb; | 116 | + sched_name varchar(120) not null comment '调度名称', |
| 117 | + entry_id varchar(95) not null comment '调度器实例id', | ||
| 118 | + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键', | ||
| 119 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 120 | + instance_name varchar(200) not null comment '调度器实例名', | ||
| 121 | + fired_time bigint(13) not null comment '触发的时间', | ||
| 122 | + sched_time bigint(13) not null comment '定时器制定的时间', | ||
| 123 | + priority integer not null comment '优先级', | ||
| 124 | + state varchar(16) not null comment '状态', | ||
| 125 | + job_name varchar(200) null comment '任务名称', | ||
| 126 | + job_group varchar(200) null comment '任务组名', | ||
| 127 | + is_nonconcurrent varchar(1) null comment '是否并发', | ||
| 128 | + requests_recovery varchar(1) null comment '是否接受恢复执行', | ||
| 129 | + primary key (sched_name, entry_id) | ||
| 130 | +) engine=innodb comment = '已触发的触发器表'; | ||
| 127 | 131 | ||
| 128 | -- ---------------------------- | 132 | -- ---------------------------- |
| 129 | -- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例 | 133 | -- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例 |
| 130 | -- ---------------------------- | 134 | -- ---------------------------- |
| 131 | -drop table if exists QRTZ_SCHEDULER_STATE; | ||
| 132 | create table QRTZ_SCHEDULER_STATE ( | 135 | create table QRTZ_SCHEDULER_STATE ( |
| 133 | - sched_name varchar(120) not null, | ||
| 134 | - instance_name varchar(200) not null, | ||
| 135 | - last_checkin_time bigint(13) not null, | ||
| 136 | - checkin_interval bigint(13) not null, | ||
| 137 | - primary key (sched_name,instance_name) | ||
| 138 | -) engine=innodb; | 136 | + sched_name varchar(120) not null comment '调度名称', |
| 137 | + instance_name varchar(200) not null comment '之前配置文件中org.quartz.scheduler.instanceId配置的名字,就会写入该字段', | ||
| 138 | + last_checkin_time bigint(13) not null comment '上次检查时间', | ||
| 139 | + checkin_interval bigint(13) not null comment '检查间隔时间', | ||
| 140 | + primary key (sched_name, instance_name) | ||
| 141 | +) engine=innodb comment = '调度器状态表'; | ||
| 139 | 142 | ||
| 140 | -- ---------------------------- | 143 | -- ---------------------------- |
| 141 | -- 10、 存储程序的悲观锁的信息(假如使用了悲观锁) | 144 | -- 10、 存储程序的悲观锁的信息(假如使用了悲观锁) |
| 142 | -- ---------------------------- | 145 | -- ---------------------------- |
| 143 | -drop table if exists QRTZ_LOCKS; | ||
| 144 | create table QRTZ_LOCKS ( | 146 | create table QRTZ_LOCKS ( |
| 145 | - sched_name varchar(120) not null, | ||
| 146 | - lock_name varchar(40) not null, | ||
| 147 | - primary key (sched_name,lock_name) | ||
| 148 | -) engine=innodb; | 147 | + sched_name varchar(120) not null comment '调度名称', |
| 148 | + lock_name varchar(40) not null comment '悲观锁名称', | ||
| 149 | + primary key (sched_name, lock_name) | ||
| 150 | +) engine=innodb comment = '存储的悲观锁信息表'; | ||
| 149 | 151 | ||
| 150 | -drop table if exists QRTZ_SIMPROP_TRIGGERS; | 152 | +-- ---------------------------- |
| 153 | +-- 11、 Quartz集群实现同步机制的行锁表 | ||
| 154 | +-- ---------------------------- | ||
| 151 | create table QRTZ_SIMPROP_TRIGGERS ( | 155 | create table QRTZ_SIMPROP_TRIGGERS ( |
| 152 | - sched_name varchar(120) not null, | ||
| 153 | - trigger_name varchar(200) not null, | ||
| 154 | - trigger_group varchar(200) not null, | ||
| 155 | - str_prop_1 varchar(512) null, | ||
| 156 | - str_prop_2 varchar(512) null, | ||
| 157 | - str_prop_3 varchar(512) null, | ||
| 158 | - int_prop_1 int null, | ||
| 159 | - int_prop_2 int null, | ||
| 160 | - long_prop_1 bigint null, | ||
| 161 | - long_prop_2 bigint null, | ||
| 162 | - dec_prop_1 numeric(13,4) null, | ||
| 163 | - dec_prop_2 numeric(13,4) null, | ||
| 164 | - bool_prop_1 varchar(1) null, | ||
| 165 | - bool_prop_2 varchar(1) null, | ||
| 166 | - primary key (sched_name,trigger_name,trigger_group), | ||
| 167 | - foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) | ||
| 168 | -) engine=innodb; | 156 | + sched_name varchar(120) not null comment '调度名称', |
| 157 | + trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_ name的外键', | ||
| 158 | + trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键', | ||
| 159 | + str_prop_1 varchar(512) null comment 'String类型的trigger的第一个参数', | ||
| 160 | + str_prop_2 varchar(512) null comment 'String类型的trigger的第二个参数', | ||
| 161 | + str_prop_3 varchar(512) null comment 'String类型的trigger的第三个参数', | ||
| 162 | + int_prop_1 int null comment 'int类型的trigger的第一个参数', | ||
| 163 | + int_prop_2 int null comment 'int类型的trigger的第二个参数', | ||
| 164 | + long_prop_1 bigint null comment 'long类型的trigger的第一个参数', | ||
| 165 | + long_prop_2 bigint null comment 'long类型的trigger的第二个参数', | ||
| 166 | + dec_prop_1 numeric(13,4) null comment 'decimal类型的trigger的第一个参数', | ||
| 167 | + dec_prop_2 numeric(13,4) null comment 'decimal类型的trigger的第二个参数', | ||
| 168 | + bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数', | ||
| 169 | + bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数', | ||
| 170 | + primary key (sched_name, trigger_name, trigger_group), | ||
| 171 | + foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group) | ||
| 172 | +) engine=innodb comment = '同步机制的行锁表'; | ||
| 169 | 173 | ||
| 170 | commit; | 174 | commit; |
-
请 注册 或 登录 后发表评论