Skip to content

Commit a63e857

Browse files
committed
feat: allow template admins to configure 1h/ttl bump
1 parent dd161b1 commit a63e857

File tree

15 files changed

+194
-81
lines changed

15 files changed

+194
-81
lines changed

coderd/database/dump.sql

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BEGIN;
2+
3+
ALTER TABLE templates DROP COLUMN activity_bump_by_1h;
4+
5+
DROP VIEW template_with_users;
6+
7+
CREATE VIEW
8+
template_with_users
9+
AS
10+
SELECT
11+
templates.*,
12+
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url,
13+
coalesce(visible_users.username, '') AS created_by_username
14+
FROM
15+
templates
16+
LEFT JOIN
17+
visible_users
18+
ON
19+
templates.created_by = visible_users.id;
20+
21+
COMMENT ON VIEW template_with_users IS 'Joins in the username + avatar url of the created by user.';
22+
23+
COMMIT;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BEGIN;
2+
3+
ALTER TABLE templates ADD COLUMN activity_bump_by_1h boolean not null default false;
4+
5+
DROP VIEW template_with_users;
6+
7+
CREATE VIEW
8+
template_with_users
9+
AS
10+
SELECT
11+
templates.*,
12+
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url,
13+
coalesce(visible_users.username, '') AS created_by_username
14+
FROM
15+
templates
16+
LEFT JOIN
17+
visible_users
18+
ON
19+
templates.created_by = visible_users.id;
20+
21+
COMMENT ON VIEW template_with_users IS 'Joins in the username + avatar url of the created by user.';
22+
23+
COMMIT;

coderd/database/models.go

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/querier.go

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 51 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)