Open felipeYoungi opened 1 year ago
We are going to leave this for the second part of the sprint.
This documentation could be helpful for this issue. https://supabase.com/docs/guides/functions/local-development#running-edge-functions-locally
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 supabaseadmin 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:
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.