migratio is a lightweight, automated migration tool for PostgreSQL with support for both SQL and JavaScript migration files. The current stable version is 2.0.3, released with an engine requirement of Node.js >=4. It runs migrations in transactions with table-level locking to ensure atomic batch execution. Key differentiators include support for async/await and generators out of the box, configurable defaults via package.json, and a non-verbose API with current, up, and down commands. The package is published on npm and distributed as CommonJS.
npm install migratioNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to require migratio, connect to Postgres, and run current/up/down commands with verbose output.
Ensure all migration files start with digits followed by a hyphen.
Use the 'unsafe' option to disable locking, but be aware of potential concurrency issues.
Set the DATABASE_URL environment variable or pass 'connection' explicitly.
Upgrade Node to version 4 or later.
Use const migratio = require('migratio'); instead of import.Run 'npm install --save migratio' in your project directory.
Ensure connection string is correct for your Postgres instance, e.g., 'postgres://user:password@localhost:5432/db'.
Install co: npm install --save co, or convert generator functions to async/await.