Skip to content

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

compose the creator/updator relationship in backups.

spinningbot16253dee7277
diff --git a/frontend/src/components/BackupTable.vue b/frontend/src/components/BackupTable.vue
index c578738405..8cdd35ee29 100644
--- a/frontend/src/components/BackupTable.vue
+++ b/frontend/src/components/BackupTable.vue
@@ -21,7 +21,7 @@
{{ humanizeTs(backup.createdTs) }}
</BBTableCell>
<BBTableCell class="w-4">
- {{ backup.creator }}
+ {{ backup.creator.name }}
</BBTableCell>
</template>
</BBTable>
diff --git a/server/database.go b/server/database.go
index f99ab12e93..8090ac7e6b 100644
--- a/server/database.go
+++ b/server/database.go
@@ -367,6 +367,9 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {
for _, backup := range backupList {
backup.Database = database
+ if err := s.ComposeBackupRelationship(context.Background(), backup); err != nil {
+ return echo.NewHTTPError(http.StatusInternalServerError, "Failed to compose backup relationship").SetInternal(err)
+ }
}
c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
@@ -585,3 +588,17 @@ func (s *Server) ComposeDatabaseRelationship(ctx context.Context, database *api.
return nil
}
+
+// ComposeBackupRelationship will compose the relationship of a backup.
+func (s *Server) ComposeBackupRelationship(ctx context.Context, backup *api.Backup) error {
+ var err error
+ backup.Creator, err = s.ComposePrincipalById(ctx, backup.CreatorId)
+ if err != nil {
+ return err
+ }
+ backup.Updater, err = s.ComposePrincipalById(ctx, backup.UpdaterId)
+ if err != nil {
+ return err
+ }
+ return nil
+}