I'll start by reading the key files to understand the task.
{
"path": "README.md"
}3 lines, 25 B
# orders migrations
Schema for the orders service. `migrations/` is applied in file order by
./db.sh apply migrations/<file>
which is `psql -v ON_ERROR_STOP=1 -f`, so each statement runs in its own implicit
transaction. The runner does not wrap a file in a transaction block, on purpose: a batched
backfill has to be able to commit between batches, and a procedure that commits cannot run
inside a transaction block. Do not add `BEGIN` or `COMMIT` around a whole file.
## The local cluster
There is no PostgreSQL service and no network. `db.sh` owns a throwaway cluster in
`./pgdata` that talks over a unix socket inside that directory:
showing 16 of 50 lines