1 Commits

Author SHA256 Message Date
Alphaeus Mote 74399e7fc6 feat(database): Postgres backups with pg_dump and a migrate-database verb [skip ci]
Settings › Database backs up Postgres: a pg_dump custom-format archive
(executer-postgres-<stamp>.dump), checked with pg_restore --list, to the
server folder and/or the S3 store with the same retention as SQLite
(pruning only this provider's backups). pg_dump comes from PG_DUMP_PATH or
PATH; without it the console says so, as before. The backend image installs
postgresql-client-18 from apt.postgresql.org and sets PG_DUMP_PATH.

migrate-database copies a SQLite database into the configured Postgres one
through EF (both at the same migration), in foreign-key order, in one
transaction, keeping keys, identity values (sequences moved past them),
concurrency stamps and values equal to a column default, and checks every
table's row count on both sides before committing. --overwrite empties a
target a server already started on; a non-empty -wal is refused without
--force.

Tests run the server on a throwaway Postgres database (insight, VACUUM
(ANALYZE), backups restored with pg_restore, retention) and the copy end to
end; both skip without PG* variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 05:07:40 -05:00