Refactor partnumber book catalog storage
This commit is contained in:
@@ -69,6 +69,7 @@ make build-all # cross-compile Linux/macOS/Windows
|
||||
|
||||
# Migrations
|
||||
go run ./cmd/pfs -migrate
|
||||
make backup-db
|
||||
|
||||
# Version
|
||||
./bin/pfs -version
|
||||
@@ -87,6 +88,7 @@ make clean
|
||||
| Target | Action |
|
||||
|--------|--------|
|
||||
| `run` | `go run ./cmd/pfs` |
|
||||
| `backup-db` | Run `go run ./cmd/dbbackup` using current `config.yaml` |
|
||||
| `build` | Dev build with debug info |
|
||||
| `build-release` | `-s -w` stripped + version ldflags |
|
||||
| `build-linux` | GOOS=linux GOARCH=amd64 |
|
||||
@@ -121,6 +123,32 @@ SQL migrations in `migrations/` (25 files). Applied automatically on startup.
|
||||
|
||||
Manual run: `go run ./cmd/pfs -migrate`
|
||||
|
||||
Before any migration or DB repair:
|
||||
|
||||
```bash
|
||||
make backup-db
|
||||
```
|
||||
|
||||
Backup helper:
|
||||
|
||||
```bash
|
||||
go run ./cmd/dbbackup
|
||||
# optional:
|
||||
go run ./cmd/dbbackup --config /path/to/config.yaml --out-dir /path/to/backups
|
||||
```
|
||||
|
||||
Default output path:
|
||||
|
||||
```text
|
||||
<PriceForge state dir>/backups/
|
||||
```
|
||||
|
||||
Example on macOS:
|
||||
|
||||
```text
|
||||
~/Library/Application Support/PriceForge/backups/
|
||||
```
|
||||
|
||||
Migration runner: `internal/models/sql_migrations.go`
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user