mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add user quiet hours schedule and restart requirement feature flag (#8115)
This commit is contained in:
@@ -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
|
||||
;
|
||||
|
||||
@@ -241,3 +241,12 @@ FROM
|
||||
users
|
||||
WHERE
|
||||
id = @user_id;
|
||||
|
||||
-- name: UpdateUserQuietHoursSchedule :one
|
||||
UPDATE
|
||||
users
|
||||
SET
|
||||
quiet_hours_schedule = $2
|
||||
WHERE
|
||||
id = $1
|
||||
RETURNING *;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user