Skip to content

Commit 79c761e

Browse files
committed
add db types
1 parent 7ad4276 commit 79c761e

File tree

6 files changed

+64
-14
lines changed

6 files changed

+64
-14
lines changed

coderd/database/dump.sql

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE ONLY workspace_apps
2+
DROP COLUMN IF EXISTS health;
3+
4+
DROP TYPE workspace_app_health;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CREATE TYPE workspace_app_health AS ENUM ('intializing', 'healthy', 'unhealthy');
2+
3+
ALTER TABLE ONLY workspace_apps
4+
ADD COLUMN IF NOT EXISTS health workspace_app_health NOT NULL DEFAULT 'intializing';

coderd/database/models.go

Lines changed: 29 additions & 8 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: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/workspaceapps.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import (
44
"github.com/google/uuid"
55
)
66

7+
// type WorkspaceAppHealth string
8+
9+
// const (
10+
// WorkspaceAppHealthInitializing = "initializing"
11+
// WorkspaceAppHealthHealthy = "healthy"
12+
// WorkspaceAppHealthUnhealthy = "unhealthy"
13+
// )
14+
715
type WorkspaceApp struct {
816
ID uuid.UUID `json:"id"`
917
// Name is a unique identifier attached to an agent.
@@ -12,4 +20,5 @@ type WorkspaceApp struct {
1220
// Icon is a relative path or external URL that specifies
1321
// an icon to be displayed in the dashboard.
1422
Icon string `json:"icon,omitempty"`
23+
// Status WorkspaceAppHealth `json:"health"`
1524
}

0 commit comments

Comments
 (0)