A PostgreSQL migration utility that lets you write migrations in SQL, with support for modular namespaces, automatic down migration storage in the database, and code tracking for functions and triggers. Current stable version: 0.5.7. Release cadence is irregular. Key differentiators: no ORM lock-in, no need to write separate down migration files (downs are stored in DB), and a focus on server-side PL code management. Primarily for developers who treat PostgreSQL as the application platform, not just a data store.
npm install dmutNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows initialization, running all pending migrations, and rolling back one step.
Periodically export down migrations using `pgmutate dump-downs` or maintain manual SQL scripts.
Use the `auto/` directory mechanism for code files instead of manual tracking.
Move pgmutate.json to `migrations/` or use the `--config` option to point to the correct location.
Ensure migration filenames are unique and sort correctly (e.g., YYYYMMDDHHMMSS.sql).
Always run down migrations before reverting code changes, or keep a manual log of down SQL.
Run `npm install pgmutate --save-dev` and ensure your import is correct: `import pgMutate from 'pgmutate'`.
Create a pgmutate.json file in the root of your migration directory (default is `migrations/`).
Start your PostgreSQL server or set the DATABASE_URL environment variable to a valid connection string.
Use `import pgMutate from 'pgmutate'` instead of `import { pgMutate } from 'pgmutate'`.