sureshanaparti commented on a change in pull request #5675:
URL: https://github.com/apache/cloudstack/pull/5675#discussion_r756014502



##########
File path: 
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
##########
@@ -3116,6 +3116,8 @@ public void doInTransactionWithoutResult(final 
TransactionStatus status) {
                                 if (networkAccount != null) {
                                     
_networkAccountDao.remove(networkAccount.getId());
                                 }
+
+                                
networkDetailsDao.removeDetails(networkFinal.getId());

Review comment:
       The foreign key should serve the purpose here. But, when a network is 
destroyed, the removed date is set, and the record is not removed from the 
table (to keep/track the history at later stage when needed). The same is the 
case with most of the resources, where the foreign key is set with 'ON DELETE 
CASCADE' but unused. May be, a cleanup (enabled/disabled) for all such removed 
entires from the DB, have to be introduced at regular intervals (that can be 
set using global config).
   
   ```
   CONSTRAINT `fk_network_details__network_id` FOREIGN KEY 
`fk_network_details__network_id`(`network_id`) REFERENCES `networks`(`id`) ON 
DELETE CASCADE
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to