File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 supabase start
2525 DB_URL=$(supabase status -o json | jq -r '.DB_URL')
2626 psql "$DB_URL" -v ON_ERROR_STOP=1 -f backend/schema.sql
27+ # schema.sql revokes client grants (anon/authenticated) but assumes a
28+ # hosted Supabase where service_role already has full table access. On a
29+ # fresh CLI stack loaded via psql, service_role gets no grants on the new
30+ # public tables, so the backend (which queries as service_role) 500s with
31+ # "permission denied for table ...". Restore the production posture.
32+ psql "$DB_URL" -v ON_ERROR_STOP=1 <<'SQL'
33+ GRANT USAGE ON SCHEMA public TO service_role;
34+ GRANT ALL ON ALL TABLES IN SCHEMA public TO service_role;
35+ GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO service_role;
36+ GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO service_role;
37+ SQL
2738
2839 - name : Wire env + start backend
2940 run : |
You can’t perform that action at this time.
0 commit comments