-- ----------------------------
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型，JobStore 并不知道如何存储实例的时候)
-- ----------------------------
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;

CREATE TABLE QRTZ_BLOB_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的外键
    blob_data     BYTEA,                                                   -- 存放持久化Trigger对象
    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_BLOB_TRIGGERS IS 'Blob类型的触发器表';
COMMENT ON COLUMN QRTZ_BLOB_TRIGGERS.sched_name IS '调度名称';
COMMENT ON COLUMN QRTZ_BLOB_TRIGGERS.trigger_name IS 'qrtz_triggers表trigger_name的外键';
COMMENT ON COLUMN QRTZ_BLOB_TRIGGERS.trigger_group IS 'qrtz_triggers表trigger_group的外键';
COMMENT ON COLUMN QRTZ_BLOB_TRIGGERS.blob_data IS '存放持久化Trigger对象';





