Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 316501d

Browse files
committed
fix: address PR comments
1 parent ccd67cc commit 316501d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ALTER TABLE ONLY workspaces
2-
DROP COLUMN autostart_schedule,
3-
DROP COLUMN autostop_schedule;
2+
DROP COLUMN IF EXISTS autostart_schedule,
3+
DROP COLUMN IF EXISTS autostop_schedule;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ALTER TABLE ONLY workspaces
2-
ADD COLUMN autostart_schedule text DEFAULT NULL,
3-
ADD COLUMN autostop_schedule text DEFAULT NULL;
2+
ADD COLUMN IF NOT EXISTS autostart_schedule text DEFAULT NULL,
3+
ADD COLUMN IF NOT EXISTS autostop_schedule text DEFAULT NULL;

coderd/workspaces_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ func TestWorkspaceUpdateAutostart(t *testing.T) {
308308
)
309309

310310
err := client.UpdateWorkspaceAutostart(ctx, wsid, req)
311-
require.EqualError(t, err, fmt.Sprintf("status code 404: workspace %q does not exist", wsid), "unexpected error")
311+
require.IsType(t, err, &codersdk.Error{}, "expected codersdk.Error")
312+
coderSDKErr, _ := err.(*codersdk.Error)
313+
require.Equal(t, coderSDKErr.StatusCode(), 404, "expected status code 404")
314+
require.Equal(t, fmt.Sprintf("workspace %q does not exist", wsid), coderSDKErr.Message, "unexpected response code")
312315
})
313316
}
314317

0 commit comments

Comments
 (0)