Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: convertSheetToSchemaDesign should find deleted dbs (#8406)

p0ny617a8fde8442
diff --git a/backend/api/v1/schema_design_service.go b/backend/api/v1/schema_design_service.go
index cb69fca1ef..ae421c3127 100644
--- a/backend/api/v1/schema_design_service.go
+++ b/backend/api/v1/schema_design_service.go
@@ -518,13 +518,14 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
}
database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
- UID: sheet.DatabaseUID,
+ UID: sheet.DatabaseUID,
+ ShowDeleted: true,
})
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get database: %v", err))
}
if database == nil {
- return nil, status.Errorf(codes.NotFound, fmt.Sprintf("cannot find the database: %d", sheet.DatabaseUID))
+ return nil, status.Errorf(codes.NotFound, fmt.Sprintf("cannot find the database: %d", *sheet.DatabaseUID))
}
creator, err := s.store.GetUserByID(ctx, sheet.CreatorID)