feat(metadata): SQLite backend, storage reconciliation and local defaults
- pluggable per-domain Repository interfaces; PostgreSQL and SQLite impls - SQLite on modernc.org/sqlite (WAL, busy_timeout, foreign_keys, immediate tx) - separate migrations/sqlite and db.MigrateSQLite; store.NewPostgres/NewSQLite - cmd/reconcile compares object storage with the journal (report, then --delete) - storage.Backend.List and photos.Repository.AllStorageKeys - DB_BACKEND/SQLITE_PATH and STORAGE_BACKEND/FS_ROOT selectable; local defaults (sqlite ./galo.db, fs ./data) - Makefile reconcile/reconcile-delete; docs and .env.example updated
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: build frontend backend run migrate tidy test clean
|
||||
.PHONY: build frontend backend run migrate reconcile reconcile-delete tidy test clean
|
||||
|
||||
frontend:
|
||||
cd frontend && npm ci && npm run build
|
||||
@@ -20,6 +20,15 @@ run: backend
|
||||
migrate:
|
||||
cd backend && go run ./cmd/migrate
|
||||
|
||||
# Reconcile object storage against the metadata journal (report only).
|
||||
reconcile:
|
||||
cd backend && go run ./cmd/reconcile
|
||||
|
||||
# Reconcile and delete orphaned blobs older than --min-age (default 1h).
|
||||
# Override the grace period when needed: make reconcile-delete MIN_AGE=1m
|
||||
reconcile-delete:
|
||||
cd backend && go run ./cmd/reconcile --delete $(if $(MIN_AGE),--min-age $(MIN_AGE),)
|
||||
|
||||
tidy:
|
||||
cd backend && go mod tidy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user