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:
Generated
+13
-2
@@ -566,7 +566,9 @@ CREATE TABLE templates (
|
||||
allow_user_autostop boolean DEFAULT true NOT NULL,
|
||||
failure_ttl bigint DEFAULT 0 NOT NULL,
|
||||
inactivity_ttl bigint DEFAULT 0 NOT NULL,
|
||||
locked_ttl bigint DEFAULT 0 NOT NULL
|
||||
locked_ttl bigint DEFAULT 0 NOT NULL,
|
||||
restart_requirement_days_of_week smallint DEFAULT 0 NOT NULL,
|
||||
restart_requirement_weeks bigint DEFAULT 0 NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN templates.default_ttl IS 'The default duration for autostop for workspaces created from this template.';
|
||||
@@ -579,6 +581,10 @@ COMMENT ON COLUMN templates.allow_user_autostart IS 'Allow users to specify an a
|
||||
|
||||
COMMENT ON COLUMN templates.allow_user_autostop IS 'Allow users to specify custom autostop values for workspaces (enterprise).';
|
||||
|
||||
COMMENT ON COLUMN templates.restart_requirement_days_of_week IS 'A bitmap of days of week to restart the workspace on, starting with Monday as the 0th bit, and Sunday as the 6th bit. The 7th bit is unused.';
|
||||
|
||||
COMMENT ON COLUMN templates.restart_requirement_weeks IS 'The number of weeks between restarts. 0 or 1 weeks means "every week", 2 week means "every second week", etc. Weeks are counted from January 2, 2023, which is the first Monday of 2023. This is to ensure workspaces are started consistently for all customers on the same n-week cycles.';
|
||||
|
||||
CREATE TABLE users (
|
||||
id uuid NOT NULL,
|
||||
email text NOT NULL,
|
||||
@@ -591,9 +597,12 @@ CREATE TABLE users (
|
||||
login_type login_type DEFAULT 'password'::login_type NOT NULL,
|
||||
avatar_url text,
|
||||
deleted boolean DEFAULT false NOT NULL,
|
||||
last_seen_at timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL
|
||||
last_seen_at timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
|
||||
quiet_hours_schedule text DEFAULT ''::text NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN users.quiet_hours_schedule IS 'Daily (!) cron schedule (with optional CRON_TZ) signifying the start of the user''s quiet hours. If empty, the default quiet hours on the instance is used instead.';
|
||||
|
||||
CREATE VIEW visible_users AS
|
||||
SELECT users.id,
|
||||
users.username,
|
||||
@@ -625,6 +634,8 @@ CREATE VIEW template_with_users AS
|
||||
templates.failure_ttl,
|
||||
templates.inactivity_ttl,
|
||||
templates.locked_ttl,
|
||||
templates.restart_requirement_days_of_week,
|
||||
templates.restart_requirement_weeks,
|
||||
COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url,
|
||||
COALESCE(visible_users.username, ''::text) AS created_by_username
|
||||
FROM (public.templates
|
||||
|
||||
Reference in New Issue
Block a user