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

Selecting a schema on createClient does not work #969

Open
2 tasks done
odarriba opened this issue Feb 8, 2024 · 3 comments
Open
2 tasks done

Selecting a schema on createClient does not work #969

odarriba opened this issue Feb 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@odarriba
Copy link

odarriba commented Feb 8, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I am moving all contents from a Supabase server to another. I have exported the roles, schema and data, and inserted it again in the new server.

After that, I had to move the storage blobs from the bucket of the previous server to the new one, as indicated on this:

https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#migrate-storage-objects

But when I do, it fails on the step of obtaining the objects list from the previous DB. Inspecting the error returned I can see it fails because of this:

{
  code: '42P01',
  details: null,
  hint: null,
  message: 'relation "public.objects" does not exist'
}

and taking into account the script is selecting the schema storage for that oldSupabaseRestClient variable initialization, it does not make any sense.

I tried changing the name of the schema in the initialization in case it is just protecting storage but the error remains the same: always trying to access public.

To Reproduce

Have two instances and try to run the script on that docs page.

Expected behavior

Be able to get the list of files and continue with the migration

Screenshots

System information

  • OS: macOS
  • Browser (if applies): Does not apply
  • Version of supabase-js: 2.39.3
  • Version of Node.js: v18.16.1

Additional context

@odarriba odarriba added the bug Something isn't working label Feb 8, 2024
@belle-chang
Copy link

I have the same issue - please assist!

@belle-chang
Copy link

Figured out the problem, when accessing the schema, it needs to be:

const oldSupabaseRestClient = createClient(OLD_PROJECT_URL, OLD_PROJECT_SERVICE_KEY, {
    schema: 'storage',
})

@supabase team, can you update the docs on this?

@CooperHash
Copy link

same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants