Skip to content

Commit

Permalink
chore: update grant privilges
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Nov 16, 2023
1 parent b9d3f87 commit bbc1666
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbc1666

Please sign in to comment.