-- ----------------------------
-- 2、 存储已配置的 Trigger 的信息
-- ----------------------------
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;

CREATE TABLE QRTZ_SIMPLE_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的外键
    repeat_count    BIGINT       NOT NULL,                                 -- 重复的次数统计
    repeat_interval BIGINT       NOT NULL,                                 -- 重复的间隔时间
    times_triggered BIGINT       NOT NULL,                                 -- 已经触发的次数
    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_SIMPLE_TRIGGERS IS '简单触发器的信息表';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.sched_name IS '调度名称';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.trigger_name IS 'qrtz_triggers表trigger_name的外键';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.trigger_group IS 'qrtz_triggers表trigger_group的外键';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.repeat_count IS '重复的次数统计';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.repeat_interval IS '重复的间隔时间';
COMMENT ON COLUMN QRTZ_SIMPLE_TRIGGERS.times_triggered IS '已经触发的次数';




