feat: persist AI task state in template imports & workspace builds (#18449)

This commit is contained in:
Danny Kopping
2025-06-24 10:36:37 +00:00
committed by GitHub
parent 6cc4cfa346
commit 0238f2926d
47 changed files with 2773 additions and 530 deletions
+11 -3
View File
@@ -88,11 +88,10 @@ INSERT INTO
readme,
job_id,
created_by,
source_example_id,
has_ai_task
source_example_id
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);
-- name: UpdateTemplateVersionByID :exec
UPDATE
@@ -123,6 +122,15 @@ SET
WHERE
job_id = $1;
-- name: UpdateTemplateVersionAITaskByJobID :exec
UPDATE
template_versions
SET
has_ai_task = $2,
updated_at = $3
WHERE
job_id = $1;
-- name: GetPreviousTemplateVersion :one
SELECT
*
+11 -3
View File
@@ -121,11 +121,10 @@ INSERT INTO
deadline,
max_deadline,
reason,
template_version_preset_id,
has_ai_task
template_version_preset_id
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15);
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14);
-- name: UpdateWorkspaceBuildCostByID :exec
UPDATE
@@ -152,6 +151,15 @@ SET
updated_at = @updated_at::timestamptz
WHERE id = @id::uuid;
-- name: UpdateWorkspaceBuildAITaskByID :exec
UPDATE
workspace_builds
SET
has_ai_task = @has_ai_task,
ai_task_sidebar_app_id = @sidebar_app_id,
updated_at = @updated_at::timestamptz
WHERE id = @id::uuid;
-- name: GetActiveWorkspaceBuildsByTemplateID :many
SELECT wb.*
FROM (