bernardodemarco opened a new pull request, #12401:
URL: https://github.com/apache/cloudstack/pull/12401

   ### Description
   
   Currently, the `cloud.backups` table references a backup schedule through 
the `backup_schedule_id` field. It is only populated when a backup is created 
from a schedule. For _ad hoc_ backups, the field's value is kept as `NULL`.
   
   Additionally, when backup schedules are deleted via the 
`deleteBackupSchedule` API, their corresponding entries are expunged from the 
DB. However, the backups' references to the schedules are not cleaned up and, 
thus, these references remain indefinitely in the `cloud.backups` table. It is 
important to highlight that, although the clean up process is not performed, it 
does not cause any bugs/side effects.
   
   Therefore, this PR proposes to clean up such references before deleting 
backup schedules from the DB. The PR also cleans up some pieces of the code 
related with backup schedules, removing unused methods and moving methods' 
definitions to appropriate layers of the project.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [X] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [X] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   1. Created a backup schedule and waited for some backups to be created from 
it
   2. Deleted the backup schedule
   3. Verified that the schedule's backups did not have references pointing to 
the schedule anymore
   


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