diff --git a/src/supabase-db/sql/init-for-rds/00-postgres-user.sql b/src/supabase-db/sql/init-for-rds/00-postgres-user.sql index 2ef9423..b0cc8f0 100644 --- a/src/supabase-db/sql/init-for-rds/00-postgres-user.sql +++ b/src/supabase-db/sql/init-for-rds/00-postgres-user.sql @@ -1,9 +1,3 @@ --- default superuser +-- postgres user for developers +CREATE USER postgres WITH LOGIN; GRANT rds_replication TO postgres; - --- Supabase super admin -create user supabase_admin; -alter user supabase_admin with createdb createrole bypassrls; -grant supabase_admin to postgres; -grant rds_superuser to supabase_admin; -- for RDS -grant rds_replication to supabase_admin; -- for RDS diff --git a/src/supabase-db/sql/init-scripts/00000000000000-initial-schema.sql b/src/supabase-db/sql/init-scripts/00000000000000-initial-schema.sql index 278af84..635f765 100644 --- a/src/supabase-db/sql/init-scripts/00000000000000-initial-schema.sql +++ b/src/supabase-db/sql/init-scripts/00000000000000-initial-schema.sql @@ -5,8 +5,9 @@ create publication supabase_realtime; -- Supabase super admin --- create user supabase_admin; --- alter user supabase_admin with superuser createdb createrole replication bypassrls; +-- create user supabase_admin; -- supabase_admin is rds_superuser. +alter user supabase_admin with createdb createrole bypassrls; +grant rds_replication to supabase_admin; -- for RDS -- Supabase replication user create user supabase_replication_admin with login; diff --git a/src/supabase-db/sql/init-scripts/00000000000001-auth-schema.sql b/src/supabase-db/sql/init-scripts/00000000000001-auth-schema.sql index c6b08b0..3cf035f 100644 --- a/src/supabase-db/sql/init-scripts/00000000000001-auth-schema.sql +++ b/src/supabase-db/sql/init-scripts/00000000000001-auth-schema.sql @@ -110,7 +110,6 @@ GRANT USAGE ON SCHEMA auth TO anon, authenticated, service_role; -- Supabase super admin CREATE USER supabase_auth_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION; -grant supabase_auth_admin to postgres; -- RDS GRANT ALL PRIVILEGES ON SCHEMA auth TO supabase_auth_admin; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA auth TO supabase_auth_admin; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA auth TO supabase_auth_admin;