mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: optimize GetPrebuiltWorkspaces query (#18717)
* Adds GetRunningPrebuiltWorkspacesOptimized query * Runs both original and updated query side-by-side and logs diffs
This commit is contained in:
@@ -359,6 +359,14 @@ func Workspace(t testing.TB, db database.Store, orig database.WorkspaceTable) da
|
||||
NextStartAt: orig.NextStartAt,
|
||||
})
|
||||
require.NoError(t, err, "insert workspace")
|
||||
if orig.Deleted {
|
||||
err = db.UpdateWorkspaceDeletedByID(genCtx, database.UpdateWorkspaceDeletedByIDParams{
|
||||
ID: workspace.ID,
|
||||
Deleted: true,
|
||||
})
|
||||
require.NoError(t, err, "set workspace as deleted")
|
||||
workspace.Deleted = true
|
||||
}
|
||||
return workspace
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user