-
In my current setup, I have a list of objects in a database table. For each object there is a dedicated folder in storage to store files for that object. I want to create a trigger that deletes the folder/all files from that object from storage on row delete in the database table. How can I accomplish this? The only way to access storage that I know is via the client libraries which use REST apis. Do I have to use them in a postgresql function too? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can set up a trigger like this in the Supabase dashboard SQL editor: CREATE TRIGGER your_trigger_name
AFTER DELETE ON your_database_table
FOR EACH ROW
EXECUTE FUNCTION delete_folder_and_files(); You have to make sure that the |
Beta Was this translation helpful? Give feedback.
-
As @zakaria-chahboun suggested, see #3124 |
Beta Was this translation helpful? Give feedback.
As @zakaria-chahboun suggested, see #3124