fix: remove legacy knowledge card tables and compatibility code
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user