rag/models/rag_entities.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

139 lines
3.2 KiB
JSON

{
"summary": [
{
"name": "rag_entities",
"title": "实体",
"primary": [
"id"
]
}
],
"fields": [
{
"name": "id",
"title": "ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "kb_id",
"title": "知识库ID",
"type": "str",
"length": 32,
"nullable": "yes"
},
{
"name": "name",
"title": "实体名",
"type": "str",
"length": 255,
"nullable": "yes"
},
{
"name": "entity_type",
"title": "实体类型",
"type": "str",
"length": 64,
"nullable": "yes"
},
{
"name": "description",
"title": "描述",
"type": "text",
"nullable": "yes"
},
{
"name": "graph_node_id",
"title": "图节点ID",
"type": "str",
"length": 128,
"nullable": "yes"
},
{
"name": "source_doc_ids",
"title": "来源文档ID列表",
"type": "text",
"nullable": "yes"
},
{
"name": "face_embedding_id",
"title": "人脸特征ID",
"type": "str",
"length": 128,
"nullable": "yes"
},
{
"name": "voice_embedding_id",
"title": "声纹特征ID",
"type": "str",
"length": 128,
"nullable": "yes"
},
{
"name": "metadata",
"title": "元数据JSON",
"type": "text",
"nullable": "yes"
},
{
"name": "org_id",
"title": "所属机构",
"type": "str",
"length": 32,
"nullable": "yes"
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "yes"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime",
"nullable": "yes"
}
],
"indexes": [
{
"name": "idx_entity_kb",
"idxtype": "index",
"idxfields": [
"kb_id"
]
},
{
"name": "idx_entity_name",
"idxtype": "index",
"idxfields": [
"kb_id",
"name"
]
},
{
"name": "idx_entity_type",
"idxtype": "index",
"idxfields": [
"kb_id",
"entity_type"
]
},
{
"name": "idx_entity_face",
"idxtype": "index",
"idxfields": [
"face_embedding_id"
]
},
{
"name": "idx_entity_voice",
"idxtype": "index",
"idxfields": [
"voice_embedding_id"
]
}
]
}