- 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 迁移
111 lines
2.5 KiB
JSON
111 lines
2.5 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "rag_usage_logs",
|
|
"title": "用量日志",
|
|
"primary": [
|
|
"id"
|
|
]
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "org_id",
|
|
"title": "机构ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "kb_id",
|
|
"title": "知识库ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "operation",
|
|
"title": "操作类型",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "bytes_delta",
|
|
"title": "磁盘变化(字节)",
|
|
"type": "int",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "bytes_total",
|
|
"title": "累计磁盘",
|
|
"type": "int",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "api_calls",
|
|
"title": "API调用数",
|
|
"type": "int",
|
|
"nullable": "yes",
|
|
"default": "1"
|
|
},
|
|
{
|
|
"name": "engine_type",
|
|
"title": "引擎类型",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "tokens_used",
|
|
"title": "Token消耗",
|
|
"type": "int",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "cost_estimate",
|
|
"title": "预估费用",
|
|
"type": "double",
|
|
"length": 20,
|
|
"dec": 4,
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "detail",
|
|
"title": "详情JSON",
|
|
"type": "text",
|
|
"nullable": "yes"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "创建时间",
|
|
"type": "datetime",
|
|
"nullable": "yes"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_usage_org",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"org_id",
|
|
"created_at"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_usage_kb",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"kb_id"
|
|
]
|
|
}
|
|
]
|
|
}
|