diff --git a/push/topology.go b/push/topology.go index f2b917cd..a69bdba3 100644 --- a/push/topology.go +++ b/push/topology.go @@ -70,7 +70,7 @@ func PushTopology(c echo.Context) error { } var idsToDelete []string - if err := ctx.DB().Model(&models.Component{}).Select("id").Where("topology_id = ?", data.TopologyID).Where("id NOT IN ?", returnedIDs).Find(&idsToDelete).Error; err != nil { + if err := ctx.DB().Model(&models.Component{}).Select("id").Where("topology_id = ?", data.TopologyID).Where("deleted_at IS NULL").Where("id NOT IN ?", returnedIDs).Find(&idsToDelete).Error; err != nil { return dutyAPI.WriteError(c, dutyAPI.Errorf(dutyAPI.EINTERNAL, "error querying old components: %v", dutydb.ErrorDetails(err))) }