A PostgreSQL-specific database migration tool for Node.js, built as a fork of the original node-pg-migrate with two extensions: prioritization of DATABASE_URL environment variable over JSON config, and a flag to skip tracking applied migrations (useful for migrating stored functions). Current stable version is 5.6.0-patch.6, released as a patch fork. The library provides a programmatic API and CLI to create and run migrations using a fluent builder pattern for SQL operations, automatically inferring down migrations. It supports ES modules and TypeScript types, and requires the pg peer dependency (>=4.3.0 <9.0.0). Unlike generic migration tools, it is built exclusively for PostgreSQL, offering full-featured PostgreSQL-specific operations without sacrificing simplicity.
npm install node-pg-migrate-customNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a migration file and runs it against a PostgreSQL database using DATABASE_URL environment variable.
Update migration files to use export const up = (pgm) => { ... } and ensure package.json has "type": "module" or use .mjs extension.Ensure DATABASE_URL is set to the desired connection string or unset it to use JSON config.
Install a compatible pg version: npm install pg@^8 (or appropriate version within range).
Refer to the docs at https://salsita.github.io/node-pg-migrate for the custom fork.
Only use skip-tracking for migrations that are idempotent (e.g., stored function definitions) to avoid data corruption.
Run: npm install node-pg-migrate-custom pg
Change to export const up = (pgm) => { ... } and ensure 'type': 'module' in package.json.Install a compatible version: npm install pg@^8
Use export const up = (pgm) => { ... } in migration files.