fix: remove legacy knowledge card tables and compatibility code

This commit is contained in:
Eric 1549169735@qq.com
2026-08-20 21:58:04 +08:00
parent ebaf9b0b05
commit 6185e6cd49
36 changed files with 545 additions and 546 deletions

View File

@@ -9,7 +9,7 @@ import (
func (h *Handler) fieldReferencedByReleasedSOP(scenarioID uint64, fieldKey string, tenantID uint64) bool {
statuses := []string{"published", "offline", "superseded"}
var nodes []model.SOPNode
err := h.db.Table("sop_nodes n").Select("n.*").Joins("JOIN sop_versions sv ON sv.id = n.sop_version_id").Joins("JOIN sops s ON s.id = sv.sop_id").Where("s.scenario_id = ? AND n.tenant_id = ? AND sv.status IN ?", scenarioID, tenantID, statuses).Scan(&nodes).Error
err := h.db.Table("sop_nodes n").Select("n.*").Joins("JOIN sops s ON s.id = n.sop_id").Where("s.scenario_id = ? AND n.tenant_id = ? AND s.status IN ?", scenarioID, tenantID, statuses).Scan(&nodes).Error
if err != nil {
return true
}
@@ -19,7 +19,7 @@ func (h *Handler) fieldReferencedByReleasedSOP(scenarioID uint64, fieldKey strin
}
}
var edges []model.SOPEdge
err = h.db.Table("sop_edges e").Select("e.*").Joins("JOIN sop_versions sv ON sv.id = e.sop_version_id").Joins("JOIN sops s ON s.id = sv.sop_id").Where("s.scenario_id = ? AND e.tenant_id = ? AND sv.status IN ?", scenarioID, tenantID, statuses).Scan(&edges).Error
err = h.db.Table("sop_edges e").Select("e.*").Joins("JOIN sops s ON s.id = e.sop_id").Where("s.scenario_id = ? AND e.tenant_id = ? AND s.status IN ?", scenarioID, tenantID, statuses).Scan(&edges).Error
if err != nil {
return true
}