finds.dev← search

// the find

salsita/node-pg-migrate

★ 1,486 · TypeScript · MIT · updated Oct 2026

Node.js database migration management for PostgreSQL

A migration runner for PostgreSQL where each migration is a JS or TS file that calls a builder API (createTable, addColumns, and so on) and emits SQL. It suits teams that want a thin layer over Postgres and don't need to support other databases.

The builder passes raw SQL through instead of wrapping types in its own constants, so `pgm.func('current_timestamp')` and strings like `varchar(1000)` reach Postgres unchanged. CI runs against Postgres 14 through 18 with recorded snapshot output per version, plus a separate CockroachDB workflow, so dialect drift gets caught. Dry-run, redo, and rerun behaviour each have their own integration spec. Down migrations can be inferred from the recorded operation stack for simple changes, which saves writing them by hand.

The README says down inference works only 'sometimes', and raw `pgm.sql` steps have no inverse the builder can derive, so those need an explicit `down`. Node 22.12 or later and Postgres 14 or later are required, and anything older is untested. The loader surface is wide: templates exist for .js, .cjs, .mjs, .ts, .cts, .mts and .sql, and jiti and tsconfig-paths specs cover the loading paths, so a toolchain change can break migrations in ways a single-language project would not see. Maintenance rests on three named maintainers after Salsita and Theo Ephraim moved to the former list. The last push was yesterday, so it is active, but check the issue tracker before putting a production schema pipeline on it.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →