diff --git a/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql b/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql similarity index 55% rename from migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql rename to migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql index a6470f7eb..7f8f30d73 100644 --- a/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_and_storage.sql +++ b/migrations/db/migrations/20240319072844_lock_down_postgres_access_to_auth_migrations.sql @@ -3,8 +3,4 @@ revoke supabase_auth_admin from postgres; revoke all on table auth.schema_migrations from postgres; grant select on table auth.schema_migrations to postgres; -revoke supabase_storage_admin from postgres; -revoke all on table storage.migrations from postgres; -grant select on table storage.migrations to postgres; - -- migrate:down diff --git a/migrations/tests/database/privs.sql b/migrations/tests/database/privs.sql index 217da662a..57f746b64 100644 --- a/migrations/tests/database/privs.sql +++ b/migrations/tests/database/privs.sql @@ -28,3 +28,7 @@ SELECT schema_privs_are('extensions', 'postgres', array['CREATE', 'USAGE']); SELECT schema_privs_are('extensions', 'anon', array['USAGE']); SELECT schema_privs_are('extensions', 'authenticated', array['USAGE']); SELECT schema_privs_are('extensions', 'service_role', array['USAGE']); + +-- Verify auth schema privileges +SELECT schema_privs_are('auth', 'postgres', array['CREATE', 'USAGE']); +SELECT table_privs_are('auth', 'schema_migrations', 'postgres', array['SELECT']);