Attachments: Only delete objects from minio that are no longer referenced in the sms (Follow-up from "imporove exception handling")
The basic idea is to check if we still use a url for another attachment (for device, for platforms, for configurations) before we delete them from our object storage (minio). Basically it could just be a count query with the url against the database to know if the url is still in use.
Background:
The following discussion from !248 (merged) should be addressed:
-
@nils.brinckmann started a discussion: I think this one is for another issue, but I fear that we will need a check about how many other attachments use the very same url (so in case we have a copy function for devices later, that we don't delete a device and remove all the attachments from the object store while this url should still be provided for a copied device).
But anyway it would be more a thing to add to the
delete_attachments_in_minio_by_url
code (and as mentioned a new issue as well).