Handling orphaned files in Bubble storage

Hey George, I’ve seen you actively in the form and just want to say I respect the contributions you make!

I follow a similar method of having a “Media” data type and inside “Media” I have fields that help me add some context to the image or video file.

Generally for orphaned files, I use database triggers to delete them. I have a field named “Deleted” which is a yes or no. My trigger is looking for “Media before’s deleted = no and Media now’s deleted = yes”.

I do this for most objects that have the chance of being deleted because there are usually a set of action’s I need done after something is deleted.

1 Like