FeatureFuel
3

[Feature] - File Garbage Collector - Unreferenced Files

Source: directus/directus#24663 · opened by @NilsBaumgartner1994
Summary

Allow image fields to trigger directus_files deletion

Basic Example

So consider this:
• I have a table called "buildings" and a building has a field of type "image"
• When i delete the building i want to clean up the unused image

Motivation

Support a clean database and reduce files without purpose

Detailed Design

Either add new relation information for image fields to delete the image when the item itself gets deleted.

Requirements List

Must Have:

• Image Cascade Delete Trigger


Drawbacks

Alternatives

Another idea would be, to add to the "directus_files" a "1:n" field and then check in a schedule weather the keys to that relationship exist. If none of these "1:n" fields have a relationship, then the image is stale and might be deleted. But that approach is not very nice.

Adoption Strategy

Unresolved Questions

_No response_

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests