-- ----------------------------
-- 4、 存储 Cron Trigger，包括 Cron 表达式和时区信息
-- ----------------------------
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;

CREATE TABLE QRTZ_CRON_TRIGGERS
(
    sched_name      VARCHAR(120) NOT NULL,                                 -- 调度名称
    trigger_name    VARCHAR(200) NOT NULL,                                 -- qrtz_triggers表trigger_name的外键
    trigger_group   VARCHAR(200) NOT NULL,                                 -- qrtz_triggers表trigger_group的外键
    cron_expression VARCHAR(200) NOT NULL,                                 -- cron表达式
    time_zone_id    VARCHAR(80),                                           -- 时区
    PRIMARY KEY (sched_name, trigger_name, trigger_group),                 -- 主键
    FOREIGN KEY (sched_name, trigger_name, trigger_group)
        REFERENCES QRTZ_TRIGGERS (sched_name, trigger_name, trigger_group) -- 外键约束
);

COMMENT ON TABLE QRTZ_CRON_TRIGGERS IS 'Cron类型的触发器表';
COMMENT ON COLUMN QRTZ_CRON_TRIGGERS.sched_name IS '调度名称';
COMMENT ON COLUMN QRTZ_CRON_TRIGGERS.trigger_name IS 'qrtz_triggers表trigger_name的外键';
COMMENT ON COLUMN QRTZ_CRON_TRIGGERS.trigger_group IS 'qrtz_triggers表trigger_group的外键';
COMMENT ON COLUMN QRTZ_CRON_TRIGGERS.cron_expression IS 'cron表达式';
COMMENT ON COLUMN QRTZ_CRON_TRIGGERS.time_zone_id IS '时区';




