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_
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.
Comments
Similar requests
When setting a Root Folder in a file/image field, we still have access to All Files, My Files and Recent Files.
1 vote · 0 comments
Better folder management
3 votes · 0 comments
Replacing a file is confusing
12 votes · 0 comments
Sqlar support for File Library
1 vote · 0 comments
Allow Direct File Upload via Item Creation
7 votes · 0 comments
No comments yet.