feat: add user quiet hours schedule and restart requirement feature flag (#8115)

This commit is contained in:
Dean Sheather
2023-07-20 23:35:41 +10:00
committed by GitHub
parent 4821e2e6d8
commit dc8b73168e
67 changed files with 4340 additions and 767 deletions
+5 -3
View File
@@ -118,9 +118,11 @@ SET
allow_user_autostop = $4,
default_ttl = $5,
max_ttl = $6,
failure_ttl = $7,
inactivity_ttl = $8,
locked_ttl = $9
restart_requirement_days_of_week = $7,
restart_requirement_weeks = $8,
failure_ttl = $9,
inactivity_ttl = $10,
locked_ttl = $11
WHERE
id = $1
;
+9
View File
@@ -241,3 +241,12 @@ FROM
users
WHERE
id = @user_id;
-- name: UpdateUserQuietHoursSchedule :one
UPDATE
users
SET
quiet_hours_schedule = $2
WHERE
id = $1
RETURNING *;
-14
View File
@@ -347,20 +347,6 @@ SET
WHERE
id = $1;
-- name: UpdateWorkspaceTTLToBeWithinTemplateMax :exec
UPDATE
workspaces
SET
ttl = LEAST(ttl, @template_max_ttl::bigint)
WHERE
template_id = @template_id
-- LEAST() does not pick NULL, so filter it out as we don't want to set a
-- TTL on the workspace if it's unset.
--
-- During build time, the template max TTL will still be used if the
-- workspace TTL is NULL.
AND ttl IS NOT NULL;
-- name: GetDeploymentWorkspaceStats :one
WITH workspaces_with_jobs AS (
SELECT