added sync command (#25)

This commit is contained in:
Arwid Thornström
2025-03-25 08:55:14 +01:00
committed by GitHub
parent 49deffc8ba
commit 5a12a0d214
2 changed files with 151 additions and 0 deletions
+14
View File
@@ -6,3 +6,17 @@ You often have the address in your .pgpass
Sync the downloaded file to your localhost with 4 cores
`./pwdb sync [address] localhost -j 4 -p`
To get a production db with grants
If something is wrong with the db. Like you get errors from API2.
Then you open postgres console with `psql photowall` and run
```
REVOKE ALL ON SCHEMA public FROM public;
GRANT USAGE ON SCHEMA public TO photowall;
GRANT SELECT, UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA public TO photowall;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO photowall;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLES TO photowall;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT USAGE, SELECT ON SEQUENCES TO photowall;
```