From 49be373205eb2e6eeee0cfd066f584de81292772 Mon Sep 17 00:00:00 2001 From: Tim Burks Date: Mon, 22 Nov 2021 11:19:49 -0800 Subject: [PATCH] When APIs are deleted, delete any deployments that they own. (#395) (This is for consistency with existing behavior. In the future we will block deletion of objects when children exist unless a `force` argument is present and true.) --- server/registry/internal/storage/apis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/registry/internal/storage/apis.go b/server/registry/internal/storage/apis.go index f21751e3e..233f3c171 100644 --- a/server/registry/internal/storage/apis.go +++ b/server/registry/internal/storage/apis.go @@ -159,6 +159,8 @@ func (d *Client) DeleteApi(ctx context.Context, name names.Api) error { gorm.VersionEntityName, gorm.SpecEntityName, gorm.SpecRevisionTagEntityName, + gorm.DeploymentEntityName, + gorm.DeploymentRevisionTagEntityName, gorm.ArtifactEntityName, gorm.BlobEntityName, } {