Skip to content

Commit b696489

Browse files
feat: add parent_id column to workspace_agents table (#17758) (#17870)
Co-authored-by: Danielle Maywood <danielle@themaywoods.com>
1 parent d5622b3 commit b696489

25 files changed

+280
-27
lines changed

coderd/apidoc/docs.go

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

coderd/apidoc/swagger.json

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

coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ func WorkspaceAgentPortShare(t testing.TB, db database.Store, orig database.Work
157157
func WorkspaceAgent(t testing.TB, db database.Store, orig database.WorkspaceAgent) database.WorkspaceAgent {
158158
agt, err := db.InsertWorkspaceAgent(genCtx, database.InsertWorkspaceAgentParams{
159159
ID: takeFirst(orig.ID, uuid.New()),
160+
ParentID: takeFirst(orig.ParentID, uuid.NullUUID{}),
160161
CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
161162
UpdatedAt: takeFirst(orig.UpdatedAt, dbtime.Now()),
162163
Name: takeFirst(orig.Name, testutil.GetRandomName(t)),

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9477,6 +9477,7 @@ func (q *FakeQuerier) InsertWorkspaceAgent(_ context.Context, arg database.Inser
94779477

94789478
agent := database.WorkspaceAgent{
94799479
ID: arg.ID,
9480+
ParentID: arg.ParentID,
94809481
CreatedAt: arg.CreatedAt,
94819482
UpdatedAt: arg.UpdatedAt,
94829483
ResourceID: arg.ResourceID,

coderd/database/dump.sql

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

coderd/database/foreign_key_constraint.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE workspace_agents
2+
DROP COLUMN IF EXISTS parent_id;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE workspace_agents
2+
ADD COLUMN parent_id UUID REFERENCES workspace_agents (id) ON DELETE CASCADE;

coderd/database/models.go

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy