Skip to content

chore(coderd/database): add tasks data model - #19749

Merged
DanielleMaywood merged 1 commit into
mainfrom
danielle/tasks/data-model
Sep 10, 2025
Merged

DanielleMaywood merged 1 commit into
mainfrom
danielle/tasks/data-model

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor

Part of coder/internal#948

A notable omission in this PR compared with the RFC is a lack of the task_status type and the status column in the tasks table. This is due to some limitations with generated columns.

The generation expression can only use immutable functions and cannot use subqueries or reference anything other than the current row in any way.

Computing a status would require querying data from another table, which is forbidden. A solution to add status will be in the future. This could be in the form of a view or being defined only at the point of GetTasks or GetTaskByID.


AI Disclaimer: Claude Opus 4.1 Thinking was used to help create the testdata fixture

@DanielleMaywood
DanielleMaywood force-pushed the danielle/tasks/data-model branch 2 times, most recently from 14f03d4 to 0ede135 Compare September 9, 2025 15:38
@DanielleMaywood
DanielleMaywood force-pushed the danielle/tasks/data-model branch from 0ede135 to b4d41f0 Compare September 9, 2025 16:04
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review September 9, 2025 16:09

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Obligatory reminder to check migration number before merge!

@DanielleMaywood
DanielleMaywood merged commit 4cd0ada into main Sep 10, 2025
@DanielleMaywood
DanielleMaywood deleted the danielle/tasks/data-model branch September 10, 2025 09:01
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants