feat(coderd): use task data model when creating a new task (#20275)

Updates coder/internal#976
This commit is contained in:
Mathias Fredriksson
2025-10-23 19:12:09 +03:00
committed by GitHub
parent 0f342ecc04
commit 5c802c2627
27 changed files with 1006 additions and 124 deletions
+19
View File
@@ -5,6 +5,25 @@ VALUES
(gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8)
RETURNING *;
-- name: UpdateTaskWorkspaceID :one
UPDATE
tasks
SET
workspace_id = $2
FROM
workspaces w
JOIN
template_versions tv
ON
tv.template_id = w.template_id
WHERE
tasks.id = $1
AND tasks.workspace_id IS NULL
AND w.id = $2
AND tv.id = tasks.template_version_id
RETURNING
tasks.*;
-- name: UpsertTaskWorkspaceApp :one
INSERT INTO task_workspace_apps
(task_id, workspace_build_number, workspace_agent_id, workspace_app_id)