Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ CREATE ROLE blazer LOGIN PASSWORD 'secret';
GRANT CONNECT ON DATABASE dbname TO blazer;
GRANT USAGE ON SCHEMA public TO blazer;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO blazer;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO blazer;
ALTER DEFAULT PRIVILEGES FOR ROLE your_pg_user_that_runs_migrations IN SCHEMA public GRANT SELECT ON TABLES TO blazer;
COMMIT;
```

Note that `ALTER DEFAULT PRIVILEGES` will only `GRANT SELECT ...` for tables created by `your_pg_user_that_runs_migrations`

### MySQL and MariaDB

Create a user with read-only permissions:
Expand Down