You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/10/31 15:19:08 UTC

[GitHub] [trafficcontrol] mhoppa commented on a change in pull request #4044: Ensure server_capability can only be assigned to edges or mids

mhoppa commented on a change in pull request #4044: Ensure server_capability can only be assigned to edges or mids
URL: https://github.com/apache/trafficcontrol/pull/4044#discussion_r341200033
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/server/servers_server_capability.go
 ##########
 @@ -165,3 +186,15 @@ server) VALUES (
 :server_capability,
 :server) RETURNING server, server_capability, last_updated`
 }
+
+func scCheckServerTypeQuery() string {
+	return `
+SELECT EXISTS (
+	SELECT s.id
+	FROM server s
+	JOIN type t ON s.type = t.id
+	WHERE s.id = $1
+	AND t.use_in_table = 'server'
+	AND (t.name LIKE '%MID%' OR t.name LIKE '%EDGE%')
 
 Review comment:
   will change :) good catch

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services