首轮真实早段运行在插入 pending=1 负控行时被 knowledges 的 NOT NULL 约束拒绝(enable_status),说明控制行缺少声明形状。改为复制本轮 canonical 来源行再覆盖 id/范围/pending,负控仍由正式结算拒绝。
This commit is contained in:
@@ -109,11 +109,19 @@ CREATE TABLE `+schema+`.knowledges (LIKE public.knowledges INCLUDING ALL)`); err
|
||||
t.Fatal(err)
|
||||
}
|
||||
// 负控:同一条正式结算必须拒绝 pending=1。控制行是本夹具自己插入的,解除只按 id+租户+库删除。
|
||||
// 行形状取自本轮声明(canonical 行包含 NOT NULL 默认值),只改 id/范围/pending。
|
||||
controlID := "doc-src-pending-control"
|
||||
controlKB := "kb-source-pending-control"
|
||||
control := map[string]any{"id": controlID, "tenant_id": wsSourceTenant, "knowledge_base_id": controlKB,
|
||||
"type": "document", "title": "待处理来源(负控)", "source": "upload",
|
||||
"parse_status": "completed", "pending_subtasks_count": 1}
|
||||
control := map[string]any{}
|
||||
for key, value := range spec.rows["knowledges"][0] {
|
||||
control[key] = value
|
||||
}
|
||||
control["id"] = controlID
|
||||
control["tenant_id"] = wsSourceTenant
|
||||
control["knowledge_base_id"] = controlKB
|
||||
control["title"] = "待处理来源(负控)"
|
||||
control["parse_status"] = "completed"
|
||||
control["pending_subtasks_count"] = 1
|
||||
rawControl, err := json.Marshal(control)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user