7
Feature Request: Native Storage File Deletion Trigger on Row Delete
Source: supabase/supabase#36755 · opened by @aress31
It would be extremely helpful if Supabase Storage could natively support automatic file deletion when a related database row is deleted (e.g., via a Postgres trigger or RLS policy). Currently, this requires a workaround using the http extension in a trigger or handling file deletion in application logic, which adds complexity and maintenance overhead.
Use case:
• When a row referencing a file (e.g., in a templates or uploads table) is deleted, the corresponding file in Supabase Storage should also be deleted automatically.
• This would help keep Storage clean and prevent orphaned files.
Current workaround:
• Use a Postgres trigger with the http extension to call the Storage API, or
• Handle file deletion in backend/app logic after deleting the row.
Use case:
• When a row referencing a file (e.g., in a templates or uploads table) is deleted, the corresponding file in Supabase Storage should also be deleted automatically.
• This would help keep Storage clean and prevent orphaned files.
Current workaround:
• Use a Postgres trigger with the http extension to call the Storage API, or
• Handle file deletion in backend/app logic after deleting the row.
No pledges yet. Be the first to back this.
Comments
Similar requests
Add a "Duplicate row" action to the Table Editor
1 vote · 0 comments
Support skipping conflicting rows during CSV import
1 vote · 0 comments
Add Storage Adapter For Chrome.Local.Storage Api
3 votes · 0 comments
Add Storage Backups in Sync with Database Backups
4 votes · 0 comments
`deleteUser()`: Add option to delete user-owned files
2 votes · 0 comments
No comments yet.