pg-bump is a CLI tool (v5.0.0) for managing PostgreSQL schema migrations written in plain SQL. It is ESM-only (since v4), powered by the `postgres` library instead of `pg`, and designed for use in package.json scripts. Key differentiators: single-transaction migrations by default, advisory locking, and file-based migration definitions split into up/down SQL files. It supports make, status, up, down commands. Requires Node >=14.
npm install pg-bumpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize pg-bump, create a migration, write SQL, and apply it.
Ensure your environment supports ESM. Update connection logic if you relied on `pg` defaults (e.g., `DATABASE_URL` env var).
Use `npx pg-bump make <name>` to generate the correct directory structure.
Use `--no-transaction` flag if issues arise with transactional DDL.
Update to Node.js >=14. If you relied on importing pg-bump programmatically as CJS, you must migrate to ESM or use dynamic import().
Run `npm install @porsager/postgres`
Use `import('pg-bump')` dynamic import or switch to ESM.