Repository navigation
fix(database): add missing task media columns - #114
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes Sequelize associations between media models (Image/Video/Template) and tasks so that each media record correctly belongs to the relevant TaskModel via existing jobId and removalJobId foreign keys.
Changes:
- Replace
hasOne(TaskModel)withbelongsTo(TaskModel)for the primary task (jobId) association. - Add a second
belongsTo(TaskModel)association for the removal task (removalJobId) with a distinct alias (removalTask). - Standardize association aliases across image/video/template models (
task,removalTask).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| code/src/database/models/video.ts | Correct task associations to use jobId/removalJobId FKs with belongsTo (task/removalTask). |
| code/src/database/models/template.ts | Same association correction for templates (task/removalTask). |
| code/src/database/models/image.ts | Same association correction for images (task/removalTask). |
Keep task schema aligned with Sequelize hasOne associations. Refs #1138 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
alexmontesg
force-pushed
the
fix/GH-1138-task-associations
branch
from
August 5, 2026 09:18
3b51ae5 to
199ee02
Compare
|
jesusmpc
approved these changes
Aug 5, 2026
alexmontesg
temporarily deployed
to
azure-develop
August 5, 2026 10:40 — with
GitHub Actions
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.



Refs #1138