[Files Refactor] Set primary flag when cleaning (#2880)

* Ensure single primary per object
* Set primary file during clean
* Only show migration notes for actual migrations
This commit is contained in:
WithoutPants
2022-09-05 11:46:18 +10:00
parent 7159ab69a3
commit 6b0bcdea88
12 changed files with 117 additions and 21 deletions

View File

@@ -338,6 +338,10 @@ func (r *mutationResolver) GalleryDestroy(ctx context.Context, input models.Gall
return fmt.Errorf("gallery with id %d not found", id)
}
if err := gallery.LoadFiles(ctx, qb); err != nil {
return fmt.Errorf("loading files for gallery %d", id)
}
galleries = append(galleries, gallery)
imgsDestroyed, err = r.galleryService.Destroy(ctx, gallery, fileDeleter, deleteGenerated, deleteFile)