Branching Drift Caused by Storage Triggers
Hello,
I am trying to create a persistent staging branch that is in sync with production. The process I used was:
1. Create branch
dev
off of production
2. Run a data dump and run the dump script in dev
SQL editor
3. Run a query in production
to get all triggers so that I can manually copy them over (they don't seem to come over thru the dump)
I'm running into issues copying over some triggers on the storage table, with commands like:
CREATE TRIGGER prefixes_delete_hierarchy AFTER DELETE ON storage.prefixes FOR EACH ROW EXECUTE FUNCTION storage.delete_prefix_hierarchy_trigger();
Failing with error:
ERROR: 42P01: relation "storage.prefixes" does not exist
I've attached a screenshot of the production
storage triggers. I do not remember creating these, were they a byproduct of some setting? Can I safely delete them in production
, or copy them over to develop
?
Thanks!
3 Replies
Usually things like this are from different storage versions. The prefixes table was added 7 months ago to the storage schema. https://github.com/supabase/storage/blob/master/migrations/tenant/0026-objects-prefixes.sql
Other than that possible clue I'm not of help.
Thanks, makes sense! Do you know of any way to potentially set the storage version, or that's just determined by supabase?
Not something I mess with. For a hosted instance you can make sure you are on latest postgres version which normally updates things. For CLI the version of the CLI decides what storage server version is rolled in.