Route id is a foreign key in route_upstream relationship table. Entry in this table should be deleted before the route is deleted.
When a route delete call is made, we could first delete the entries from route_upstream table.
9b1dd9:~ v3$ curl -s -X DELETE https://ingresspipe.io:8443/service/adminservice2/route/db_requests -H "Authorization: Bearer treehugger" | python -m json.tool
{
"errors": [
{
"extensions": {
"code": "constraint-violation",
"path": "$"
},
"message": "Foreign key violation. update or delete on table \"route\" violates foreign key constraint \"route_upstream_route_id_fkey\" on table \"route_upstream\""
}
]
}