Files
ruoyi-vue-pro/sql/mysql/ydoyun_ai_assistant_dify_kb.sql
2026-04-17 09:56:29 +08:00

19 lines
1.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 每日汇报:租户 + 页面(module_code) 对应一个 Dify 知识库(dataset),保存 datasetId 与聚合文档 ID
CREATE TABLE IF NOT EXISTS `ydoyun_ai_assistant_dify_kb` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`module_code` varchar(128) NOT NULL DEFAULT '' COMMENT '模块编码(页面维度)',
`module_name` varchar(128) NOT NULL DEFAULT '' COMMENT '模块名称',
`dataset_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'Dify 知识库/数据集 ID',
`dataset_name` varchar(256) NOT NULL DEFAULT '' COMMENT 'Dify 侧知识库名称',
`aggregate_document_id` varchar(64) DEFAULT NULL COMMENT '聚合文档 ID首次创建后写入后续走更新接口',
`creator` varchar(64) DEFAULT '' NULL COMMENT '创建者',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
`updater` varchar(64) DEFAULT '' NULL COMMENT '更新者',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) DEFAULT b'0' NOT NULL COMMENT '是否删除',
`tenant_id` bigint DEFAULT 0 NOT NULL COMMENT '租户编号',
PRIMARY KEY (`id`),
KEY `idx_tenant_module` (`tenant_id`, `module_code`),
KEY `idx_module_code` (`module_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='每日汇报-Dify知识库绑定每租户每页面一条';