rag/models/rag_document_chunks.json
ymq 789960a1cf refactor(schema): rag 模块全部数据表加 rag_ 前缀(模块跨应用复用防冲突)
- models/ 重建为正确表定义格式(summary+fields+indexes),覆盖全部 11 个表
  修正原 models/ 误放 CRUD 格式副本(缺 summary)导致 json2ddl 100% 失败被静默忽略
- json/ 6 个 CRUD 定义 tblname 加前缀 + 文件改名
- 129 处 SQL/sor 表名加 rag_ 前缀(URL 路径 knowledge_bases_list 保持不变)
- 新增 init/migrate_rag_prefix.sql 幂等 RENAME TABLE 迁移
2026-08-25 14:24:37 +08:00

130 lines
2.9 KiB
JSON

{
"summary": [
{
"name": "rag_document_chunks",
"title": "文档分片",
"primary": [
"id"
]
}
],
"fields": [
{
"name": "id",
"title": "ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "doc_id",
"title": "文档ID",
"type": "str",
"length": 32,
"nullable": "yes"
},
{
"name": "kb_id",
"title": "知识库ID",
"type": "str",
"length": 32,
"nullable": "yes"
},
{
"name": "chunk_index",
"title": "分片序号",
"type": "int",
"nullable": "yes"
},
{
"name": "chunk_type",
"title": "分片类型",
"type": "str",
"length": 32,
"nullable": "yes"
},
{
"name": "content",
"title": "文本内容",
"type": "text",
"nullable": "yes"
},
{
"name": "description",
"title": "描述",
"type": "text",
"nullable": "yes"
},
{
"name": "vector_id",
"title": "向量库ID",
"type": "str",
"length": 128,
"nullable": "yes"
},
{
"name": "start_offset",
"title": "起始偏移",
"type": "int",
"nullable": "yes"
},
{
"name": "end_offset",
"title": "结束偏移",
"type": "int",
"nullable": "yes"
},
{
"name": "time_start",
"title": "时间起始(秒)",
"type": "double",
"length": 10,
"dec": 3,
"nullable": "yes"
},
{
"name": "time_end",
"title": "时间结束(秒)",
"type": "double",
"length": 10,
"dec": 3,
"nullable": "yes"
},
{
"name": "metadata",
"title": "元数据JSON",
"type": "text",
"nullable": "yes"
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "yes"
}
],
"indexes": [
{
"name": "idx_chunk_doc",
"idxtype": "index",
"idxfields": [
"doc_id"
]
},
{
"name": "idx_chunk_kb",
"idxtype": "index",
"idxfields": [
"kb_id"
]
},
{
"name": "idx_chunk_vector",
"idxtype": "index",
"idxfields": [
"vector_id"
]
}
]
}