mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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.
This commit is contained in:
@@ -2085,6 +2085,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
|
||||
agentID := uuid.New()
|
||||
dbAgent, err := db.InsertWorkspaceAgent(ctx, database.InsertWorkspaceAgentParams{
|
||||
ID: agentID,
|
||||
ParentID: uuid.NullUUID{},
|
||||
CreatedAt: dbtime.Now(),
|
||||
UpdatedAt: dbtime.Now(),
|
||||
ResourceID: resource.ID,
|
||||
|
||||
@@ -2158,6 +2158,7 @@ func TestInsertWorkspaceResource(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Len(t, agents, 1)
|
||||
agent := agents[0]
|
||||
require.Equal(t, uuid.NullUUID{}, agent.ParentID)
|
||||
require.Equal(t, "amd64", agent.Architecture)
|
||||
require.Equal(t, "linux", agent.OperatingSystem)
|
||||
want, err := json.Marshal(map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user