rob05c opened a new issue #4941:
URL: https://github.com/apache/trafficcontrol/issues/4941


   The TO Primary Key is currently `(id, cachegroup, type, status, profile)`.
   
   That is absolutely broken. It must've slipped in a migration or something, 
but the PK needs to be `id`, and tons of things will break if IDs aren't 
unique. 
   
   If necessary, we can consider adding the other columns there to their own 
unique key. But I don't think they need to be.
   
   Personally, I don't like artificial IDs. They're unnecessary and violate, 
confuse, and obfuscate relationality. Using the real Candidate Key is much 
better. But as long as we have them, it's imperative they're unique.
   
   ## I'm submitting a ...
   -  bug report
   
   ## Traffic Control components affected ...
   -  Traffic Ops
   
   ## Current behavior:
   TO Server ID is not PK
   
   ## Expected / new behavior:
   TO Server ID is PK
   
   ## Minimal reproduction of the problem with instructions:
   Insert a Server into the Database with the same ID as another. Observe chaos.
   
   ## Anything else:


----------------------------------------------------------------
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:
[email protected]


Reply via email to