CREATE TABLE IF NOT EXISTS ragflow_chunk_record (
    id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
	dataset_name VARCHAR(64) NOT NULL COMMENT '数据库ID',
	table_name VARCHAR(64) NOT NULL COMMENT '数据表ID',
	chunk_id VARCHAR(64) NOT NULL COMMENT '分块ID',
    cond VARCHAR(100) COMMENT '条件参数',
    update_data JSON COMMENT '数据参数',
    scheduled_time DATETIME NOT NULL COMMENT '计划执行时间（当前时间+20秒）',
    status VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '执行状态：0:未执行/1:执行成功/2:执行失败',
	error_message VARCHAR(255) COMMENT '失败信息',
	executed_time DATETIME COMMENT '执行时间',
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    INDEX idx_dataset_name (dataset_name),
    INDEX idx_table_name (table_name),
    INDEX idx_chunk_id (chunk_id),
    INDEX idx_scheduled_time (scheduled_time),
    INDEX idx_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='RagflowChunk记录表';