Skip to content

Commit 1f415da

Browse files
author
QA Runner
committed
tmp: add service_role grant, re-diagnose
1 parent 0e01c9e commit 1f415da

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/diag.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ jobs:
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: |

0 commit comments

Comments
 (0)