Repository navigation
Remove foreign key constraint preventing deletion of old jobs - #1119
Merged
Merged
Conversation
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 a legacy foreign key that blocks deletion of old job records. Current job tracking uses batch identifiers instead, and the change does not alter authorization or cleanup schedules. Needs human approval because:
You can add or adjust custom eligibility rules. Learn more. |
Test coverage94.2% line coverage reported by SimpleCov. |
raspberrypiherokubot
temporarily deployed
to
editor-api-p-good-job-c-6kw042
November 17, 2026 15:01
Inactive
jamiebenstead
approved these changes
Nov 20, 2026
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
force-pushed
the
good-job-cleanup
branch
from
November 23, 2026 13:31
7a41fec to
c0350b3
Compare
raspberrypiherokubot
temporarily deployed
to
editor-api-p-good-job-c-c3lmfc
November 23, 2026 13:36
Inactive
This branch was previously 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.