Let me start by understanding the task. I need to: 1. Read the README.md to see the review comment 2. Read SPEC.md to understand the column definition and the five rules 3. Look at the current migration files (0002_add_status.up.sql and 0002_add_status.down.sql) 4. Understand the current state (0001 migration, seed.sql) 5. Rewrite both migration files to pass the review Let me start by exploring the files.
{
"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