feat: supabase schema migrations + kong gateway config
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<'EOSQL'
|
||||
|
||||
-- Create authenticator role (no-login, used by PostgREST)
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'authenticator') THEN
|
||||
CREATE ROLE authenticator NOLOGIN;
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
-- Grant authenticator usage on public schema and read access to all tables
|
||||
GRANT USAGE ON SCHEMA public TO authenticator;
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO authenticator;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO authenticator;
|
||||
|
||||
EOSQL
|
||||
Reference in New Issue
Block a user