GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 9 forks source link

✨ Set up pruning logic for models #9768

Open petertgiles opened 8 months ago

petertgiles commented 8 months ago

✨ Feature

Laravel models have the ability to mark themselves as prunable. We should consider developing this logic to cleanup old data in the database. This will keep our hosting requirements down, improve the performance of database queries, and reduce UI clutter.

https://laravel.com/docs/11.x/eloquent#pruning-models

:question: Questions

Q: What are our regulatory responsibilities? Maximum or minimum amounts of time we should be archiving data?

Q: How should we actually prune old data? Manually or automatically?

Q: Should we be running extra backups before pruning?

🙋‍♀️ Proposed Implementation

Notification, unread - 3 months after created Notification, read - 1 month after read

Pool, draft - 6 months after created Pool, archived - 12 months after archived

Pool candidate - based on status?

User, archived - 6 months

Activity log (not actually a model) - 12 months after log

✅ Acceptance Criteria

🛑 Blockers

Issues which must be completed before this one.

### Blocked By
gobyrne commented 6 months ago

https://talent-cloud.slack.com/archives/CB424V61J/p1716560215012229