Skip to content

Commit 538bc42

Browse files
committed
Review comments
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent ad05920 commit 538bc42

File tree

6 files changed

+11
-29
lines changed

6 files changed

+11
-29
lines changed

coderd/database/dump.sql

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

coderd/database/migrations/000219_notifications.up.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ CREATE TABLE notification_templates
1616
(
1717
id uuid NOT NULL,
1818
name text NOT NULL,
19-
enabled boolean DEFAULT TRUE NOT NULL,
2019
title_template text NOT NULL,
2120
body_template text NOT NULL,
2221
actions jsonb,
@@ -51,8 +50,8 @@ CREATE TABLE notification_messages
5150
CREATE INDEX idx_notification_messages_status ON notification_messages (status);
5251

5352
-- TODO: autogenerate constants which reference the UUIDs
54-
INSERT INTO notification_templates (id, name, enabled, title_template, body_template, "group", actions)
55-
VALUES ('f517da0b-cdc9-410f-ab89-a86107c420ed', 'Workspace Deleted', true, E'Workspace "{{.Labels.name}}" deleted',
53+
INSERT INTO notification_templates (id, name, title_template, body_template, "group", actions)
54+
VALUES ('f517da0b-cdc9-410f-ab89-a86107c420ed', 'Workspace Deleted', E'Workspace "{{.Labels.name}}" deleted',
5655
E'Hi {{.UserName}}\n\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}**".',
5756
'Workspace Events', '[
5857
{

coderd/database/migrations/testdata/fixtures/000219_notifications.up.sql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
-- TODO: add more fixtures
2-
31
DO
42
$$
53
DECLARE
64
template text;
75
BEGIN
86
SELECT 'You successfully did {{.thing}}!' INTO template;
97

10-
INSERT INTO notification_templates (id, name, enabled, title_template, body_template, "group")
11-
VALUES ('a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', 'A', TRUE, template, template, 'Group 1'),
12-
('b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12', 'B', TRUE, template, template, 'Group 1'),
13-
('c0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13', 'C', TRUE, template, template, 'Group 2');
8+
INSERT INTO notification_templates (id, name, title_template, body_template, "group")
9+
VALUES ('a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', 'A', template, template, 'Group 1'),
10+
('b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12', 'B', template, template, 'Group 1'),
11+
('c0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13', 'C', template, template, 'Group 2');
1412

1513
INSERT INTO public.users(id, email, username, hashed_password, created_at, updated_at, status, rbac_roles, deleted)
1614
VALUES ('fc1511ef-4fcf-4a3b-98a1-8df64160e35a', 'githubuser@coder.com', 'githubuser', '\x', '2022-11-02 13:05:21.445455+02', '2022-11-02 13:05:21.445455+02', 'active', '{}', false) ON CONFLICT DO NOTHING;

coderd/database/models.go

Lines changed: 0 additions & 1 deletion
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: 3 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/notifications.sql

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
-- name: InsertNotificationTemplate :one
2-
INSERT INTO notification_templates (id, name, enabled, title_template, body_template, "group")
3-
VALUES ($1,
4-
$2,
5-
$3,
6-
$4,
7-
$5,
8-
$6)
2+
INSERT INTO notification_templates (id, name, title_template, body_template, "group")
3+
VALUES ($1, $2, $3, $4, $5)
94
RETURNING *;
105

116
-- name: FetchNewMessageMetadata :one

0 commit comments

Comments
 (0)