Repository navigation
Remove foreign key constraint preventing deletion of old jobs - #1119
Open
zetter-rpf wants to merge 1 commit into
Open
zetter-rpf wants to merge 1 commit into
zetter-rpf wants to merge 1 commit into
Conversation
When the user jobs table was made they were linked to a job, but since 2025-10-28 they have only been linked to batches. Having this constraint prevents good job from tidying up old jobs.
zetter-rpf
marked this pull request as ready for review
November 17, 2026 14:58
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — Removes an obsolete foreign key that blocks old job deletion. Current job tracking uses batch IDs, and the change does not itself delete records or alter cleanup policy. Needs human approval because:
You can add or adjust custom eligibility rules. Learn more. |
Test coverage94.19% line coverage reported by SimpleCov. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to: https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1903
When the user jobs table was made they were linked to a job, but since 2025-10-28 they have only been linked to batches.
I've manually set the
good_job_idtonullfor all records on theuser_jobstable so we can clean up old jobs. This change just makes sure that if we setgood_job_idin the future, it doesn't prevent jobs being deleted.Having this constraint prevents good job from tidying up old jobs. I've confirmed that user jobs can not have a good_job_id (or one that doesn't refer to a job that exists) and still work.