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

Setup a local instance of the Supabase backend for backend development purposes. #197

Open
felipeYoungi opened this issue Apr 18, 2023 · 3 comments
Assignees

Comments

@felipeYoungi
Copy link
Contributor

As a development team, we need to have a local instance of the Supabase backend set up so we can work on the backend code without affecting the production environment. This will allow us to test new features, make changes, and debug issues in a controlled environment before deploying to production.

@felipeYoungi
Copy link
Contributor Author

We are going to leave this for the second part of the sprint.

@felipeYoungi felipeYoungi moved this from 📋 Backlog to 🔖 Ready for development in hybrid-meetup-platform Apr 25, 2023
@JonaQuaLabs
Copy link
Contributor

This documentation could be helpful for this issue.
https://supabase.com/docs/guides/functions/local-development#running-edge-functions-locally

@yulianag-qualabs yulianag-qualabs self-assigned this May 4, 2023
@yulianag-qualabs yulianag-qualabs moved this from 🔖 Ready for development to 🏗 In progress in hybrid-meetup-platform May 4, 2023
@yulianag-qualabs
Copy link
Contributor

yulianag-qualabs commented May 5, 2023

When trying to start the local instance of Supabase by running "supabase start" command, the following error occurs:

Error: ERROR: must be a member of role "supabase_admin" (SQLSTATE 42501)

This is because tables created through the Supabase dashboard are owned by the "supabase_admin" role, while the migration scripts executed through the CLI are under the "postgres" role.

Previously, this issue could be resolved by changing the user to a superuser in PostgreSQL using either of the following commands:

GRANT supabase_admin TO postgres;
ALTER ROLE postgres with SUPERUSER;

However, Supabase has recently updated its policies, and the suggested solution in the documentation is to reassign the owner of those tables to the "postgres" role. This was attempted by executing the following commands in the SQL editor for each table, but it did not work:

ALTER TABLE roles OWNER TO postgres;
ALTER TABLE rooms OWNER TO postgres;
ALTER TABLE "rooms-data" OWNER TO postgres;
ALTER TABLE "rooms-permission" OWNER TO postgres;
ALTER TABLE "users-data" OWNER TO postgres;
ALTER TABLE "message-chat" OWNER TO postgres;

References:

Supabase documentation:

Supabase discussion on policy changes:

@yulianag-qualabs yulianag-qualabs moved this from 🏗 In progress to ❌ Blocked in hybrid-meetup-platform May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Blocked
Development

No branches or pull requests

3 participants