MCPcopy Index your code
hub / github.com/coder/coder / ArchiveUnusedTemplateVersions

Method ArchiveUnusedTemplateVersions

coderd/database/querier.go:65–65  ·  view source on GitHub ↗

Archiving templates is a soft delete action, so is reversible. Archiving prevents the version from being used and discovered by listing. Only unused template versions will be archived, which are any versions not referenced by the latest build of a workspace.

(ctx context.Context, arg ArchiveUnusedTemplateVersionsParams)

Source from the content-addressed store, hash-verified

63 // Only unused template versions will be archived, which are any versions not
64 // referenced by the latest build of a workspace.
65 ArchiveUnusedTemplateVersions(ctx context.Context, arg ArchiveUnusedTemplateVersionsParams) ([]uuid.UUID, error)
66 // Archives inactive root chats (pinned and already-archived chats skipped),
67 // cascading to children via root_chat_id. Limits apply to roots, not total
68 // rows. The Go caller passes @archive_cutoff as UTC midnight so that all

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 2

TestArchiveVersionsFunction · 0.52
TestProvisionerJobMethod · 0.52