chore(backups): ship exact DB-state dumps + restore scripts

The databases live in Docker volumes (not in git), so teammates on a fresh
boot saw an empty system. backups/procurement.dump + casdoor.dump are exact
pg_dump snapshots of the current demo state (users/roles, projects,
warehouses, quotes with receipts, inventory rows; Casdoor org/app/users);
restore.ps1 / restore.sh replace both DBs with the committed state
(--clean --if-exists, verified by a round-trip restore into throwaway DBs).
README documents how to restore and how to take a fresh dump.
This commit is contained in:
ali_mohaghegh
2026-09-02 11:21:09 +03:30
parent 31290ffbda
commit d56cd13cb9
5 changed files with 94 additions and 0 deletions
+23
View File
@@ -197,6 +197,29 @@ docker exec -it procurement-postgres psql -U postgres -d procurement
---
## Restoring the demo data (for the team)
The databases are **not** in git — Docker volumes hold the data. To let
everyone see the same system state, the repo ships exact database dumps in
`backups/` (taken 2026-09-02). After a fresh boot:
```powershell
powershell -ExecutionPolicy Bypass -File .\backups\restore.ps1 # Windows
bash backups/restore.sh # Linux / Git Bash
```
This **replaces all data** in the `procurement` and `casdoor` databases with
the committed state (users + roles, projects, warehouses, quotes with
receipts, inventory rows, Casdoor org/app/users). To create a fresh dump of
your own current state:
```powershell
docker compose stop api casdoor
docker exec procurement-postgres pg_dump -U postgres -d procurement -Fc > backups/procurement.dump # (Git Bash: use -f inside the container + docker cp)
docker exec procurement-postgres pg_dump -U postgres -d casdoor -Fc > backups/casdoor.dump
docker compose start casdoor api
```
## Common operations
```powershell