- 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 迁移
152 lines
3.4 KiB
JSON
152 lines
3.4 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "rag_documents",
|
|
"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": "folder_id",
|
|
"title": "目录ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes",
|
|
"default": ""
|
|
},
|
|
{
|
|
"name": "file_name",
|
|
"title": "文件名",
|
|
"type": "str",
|
|
"length": 255,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "file_type",
|
|
"title": "文件类型",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "file_size",
|
|
"title": "文件大小",
|
|
"type": "int",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "file_path",
|
|
"title": "文件路径",
|
|
"type": "str",
|
|
"length": 500,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "mime_type",
|
|
"title": "MIME类型",
|
|
"type": "str",
|
|
"length": 128,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "chunk_count",
|
|
"title": "分片数",
|
|
"type": "int",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "embed_dim",
|
|
"title": "向量维度",
|
|
"type": "int",
|
|
"nullable": "yes",
|
|
"default": "1024"
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"title": "元数据JSON",
|
|
"type": "text",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"title": "状态",
|
|
"type": "str",
|
|
"length": 16,
|
|
"nullable": "yes",
|
|
"default": "pending"
|
|
},
|
|
{
|
|
"name": "error_msg",
|
|
"title": "错误信息",
|
|
"type": "text",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "org_id",
|
|
"title": "所属机构",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "created_by",
|
|
"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_doc_kb",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"kb_id"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_doc_org",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"org_id"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_doc_status",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"status"
|
|
]
|
|
}
|
|
]
|
|
}
|