Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supabase db reset --linked potentially create orphaned storage objects #3252

Open
IPJT opened this issue Mar 5, 2025 · 2 comments
Open

supabase db reset --linked potentially create orphaned storage objects #3252

IPJT opened this issue Mar 5, 2025 · 2 comments

Comments

@IPJT
Copy link

IPJT commented Mar 5, 2025

Hi there,

Previously (not sure what version) when running supabase db reset --linked it failed if there were storage objects and I had to manually remove the storage objects before successfully resetting the remote db.

On v2.15.8 (and most likely versions before that) it seems like supabase db reset --linked will wipe all the metadata but not the storage objects themselves and thus creating orphaned storage objects. Doing exactly what the documentation is warning about:

Deleting objects should always be done via the Storage API and NOT via a SQL query. Deleting objects via a SQL query will not remove the object from the bucket and will result in the object being orphaned.

@doried-a-a
Copy link

Similar issue here on v2.12.1, doing supabase db reset --linked is erasing the whole storage metadata.
I was not expecting performing this command to affect the storage schema at all, is it a bug?

@sweatybridge
Copy link
Contributor

Resetting the storage schema is indeed a new behaviour we've shipped. The main use case is to more easily reset the project for seeding.

We are also trying out a new clean up job to remove orphaned objects so that wouldn't be an issue in the long term.

Could you elaborate why this behaviour is problematic for your use case? We can look into reverting this change and add a new flag instead for those who want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants