From bbc1666acbc7cbd81b9c56a47d36ecc95739ebb8 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 16 Nov 2023 18:58:56 +0530 Subject: [PATCH] chore: update grant privilges --- migrate/migrate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migrate/migrate.go b/migrate/migrate.go index 083013aa..7c2afab2 100644 --- a/migrate/migrate.go +++ b/migrate/migrate.go @@ -93,9 +93,9 @@ func grantPostgrestRolesToCurrentUser(pool *sql.DB, connection string) error { logger.Debugf("Granted postgrest_api to %s", user) grantQuery := ` - GRANT SELECT, UPDATE, DELETE, INSERT ON ALL TABLES IN SCHEMA public TO postgrest_api; - ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, UPDATE, DELETE, INSERT ON TABLES TO postgrest_api; - GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO postgrest_api; + GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgrest_api; + GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO postgrest_api; + ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO postgrest_api; ` if _, err := pool.Exec(grantQuery); err != nil { return err