Skip to content

Commit 0b5f27f

Browse files
feat: add parent_id column to workspace_agents table (#17758)
Adds a new nullable column `parent_id` to `workspace_agents` table. This lays the groundwork for having child agents.
1 parent 398b999 commit 0b5f27f

25 files changed

+278
-26
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
@@ -181,6 +181,7 @@ func WorkspaceAgentPortShare(t testing.TB, db database.Store, orig database.Work
181181
func WorkspaceAgent(t testing.TB, db database.Store, orig database.WorkspaceAgent) database.WorkspaceAgent {
182182
agt, err := db.InsertWorkspaceAgent(genCtx, database.InsertWorkspaceAgentParams{
183183
ID: takeFirst(orig.ID, uuid.New()),
184+
ParentID: takeFirst(orig.ParentID, uuid.NullUUID{}),
184185
CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
185186
UpdatedAt: takeFirst(orig.UpdatedAt, dbtime.Now()),
186187
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
@@ -9570,6 +9570,7 @@ func (q *FakeQuerier) InsertWorkspaceAgent(_ context.Context, arg database.Inser
95709570

95719571
agent := database.WorkspaceAgent{
95729572
ID: arg.ID,
9573+
ParentID: arg.ParentID,
95739574
CreatedAt: arg.CreatedAt,
95749575
UpdatedAt: arg.UpdatedAt,
95759576
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