SupabaseS
Supabase4y ago
rree

Table error after schema change

:solved:

tl;dr: Every single table that was transfered from the schema "transit" to "public" cannot be accessed, have it RLS or not. I'm using the anon key.

Problem: PostgrestException(message: permission denied for table routes, code: 42501, details: Unauthorized, hint: null)

Platform: Dart/Flutter

--------
I created a schema named "transit".
All my tables where in the "transit" scheme. Only later I noticed that there is no way currently to query a schema that is not the 'public' one in Flutter. So I moved them to the public schema. They are still not accessible though.
I tried to create a new table in the public schema, caled "testtttt". It worked as expected: as soon as I created the rule for letting everyone select it it was visible.
Every other table that changed schema (from "transit" to "public") throws this error of code 42501. Some have RLS and no permission, some have RLS and "select permission for everyone", some don't even have RLS.
Every single table that was transfered from "transit" to "public" cannot be accessed using the flutter_supabase api. Tables created directly in "public" are fine though.I've already created 18 tables and would love to keep them if possible :help_me_microsoft: I'm using the anonKey

This is the code I used for migration:
alter view transit.table_name set schema public;
Where table_name is, of course, the table name.

The first picture show the table "routes", which can't be accessed using the api.
The second shows the tables "t_test" and "testtttt". The only one that can be accessed is "testtttt". It is also the only one that was created directly in "public" and not in "transit" schema.
They all look fine in the dashboard.
Was this page helpful?