Relating Storage Objects to Public Schema Tables
I am looking to set up a relation between a table in my public schema with objects in a bucket within Supabase storage. I found some folks asking about this here https://github.com/supabase/supabase/discussions/3541 but wanted to see if anyone had any new insights into this.
I have a products table that I wanted to have a has many relation with images to, which would allow me to join products with the product_images (or whatever associated table is set up). The unknown part for me is how can I have a true association where added and deleted storage objects are reflected in the association with their product? I know that I can just store the image path(s) on the product row itself but I'm looking for a set up that has a little more reliability on if the images actually exist. Otherwise it becomes a game of making sure that I set up another product table operation after each storage object insert/delete.
Anyone's insight into how they might solve this is much appreciated. I'd really just like to keep this association as simple and reliable as possible.
Thanks!
I have a products table that I wanted to have a has many relation with images to, which would allow me to join products with the product_images (or whatever associated table is set up). The unknown part for me is how can I have a true association where added and deleted storage objects are reflected in the association with their product? I know that I can just store the image path(s) on the product row itself but I'm looking for a set up that has a little more reliability on if the images actually exist. Otherwise it becomes a game of making sure that I set up another product table operation after each storage object insert/delete.
Anyone's insight into how they might solve this is much appreciated. I'd really just like to keep this association as simple and reliable as possible.
Thanks!
GitHub
I've setup my database to use a relation field to a file upload as follows: But I'm having trouble creating the relation, I assume i need to update the record to store the file uuid...