mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
8b125d6c5d
* feat: Implement view for workspace builds to include rbac info * Removes the need to fetch the workspace to run an rbac check. * chore: Use workspace build as RBAC object * chore: Use golang templates instead of sqlc files
40 lines
631 B
SQL
40 lines
631 B
SQL
-- name: InsertWorkspaceBuild :one
|
|
INSERT INTO
|
|
workspace_builds (
|
|
id,
|
|
created_at,
|
|
updated_at,
|
|
workspace_id,
|
|
template_version_id,
|
|
"build_number",
|
|
transition,
|
|
initiator_id,
|
|
job_id,
|
|
provisioner_state,
|
|
deadline,
|
|
max_deadline,
|
|
reason
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING *;
|
|
|
|
-- name: UpdateWorkspaceBuildByID :one
|
|
UPDATE
|
|
workspace_builds
|
|
SET
|
|
updated_at = $2,
|
|
provisioner_state = $3,
|
|
deadline = $4,
|
|
max_deadline = $5
|
|
WHERE
|
|
id = $1 RETURNING *;
|
|
|
|
-- name: UpdateWorkspaceBuildCostByID :one
|
|
UPDATE
|
|
workspace_builds
|
|
SET
|
|
daily_cost = $2
|
|
WHERE
|
|
id = $1 RETURNING *;
|
|
|