Skip to content

fix(database): add missing task media columns - #114

Merged
alexmontesg merged 1 commit into
mainfrom
fix/GH-1138-task-associations
Aug 5, 2026
Merged

alexmontesg merged 1 commit into
mainfrom
fix/GH-1138-task-associations

Conversation

@alexmontesg

Copy link
Copy Markdown
Contributor

Refs #1138

@alexmontesg
alexmontesg requested review from jesusmpc and a lite review from Copilot August 5, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) with belongsTo(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
alexmontesg force-pushed the fix/GH-1138-task-associations branch from 3b51ae5 to 199ee02 Compare August 5, 2026 09:18
@alexmontesg alexmontesg changed the title fix(database): correct task associations fix(database): add missing task media columns Aug 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@alexmontesg alexmontesg self-assigned this Aug 5, 2026
@alexmontesg
alexmontesg merged commit 43a017e into main Aug 5, 2026
11 checks passed

This branch was previously deployed

1 inactive deployment
azure-develop — 199ee02b Deployed Aug 5, 2026 by alexmontesg via Deploy to Container Apps #483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants