Registry / database / migo
library0.1.4-1jsnpmunverified

Migo is a lightweight PostgreSQL migration tool that defines schema changes in a custom .migo file format with versioned up/down steps. Current version is 0.1.4-1, with low release activity. It distinguishes itself by using a simple, single-file configuration and human-readable migration files, but lacks support for modern migration patterns, rollback confirmations, and is limited to PostgreSQL. The tool is usable as a CLI for basic migrations but is unmaintained since 2015.

npm install migo
INSTALL
IMPORT
SIG · MIGO
M
migo
databasejavascriptv0.1.4-1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

migo CLI
npm install -g migo && migo.js test.migo
npx migo test.migo
The package provides a global CLI script, not a programmatic API. Use `migo.js` directly.

Demonstrates installation, creating a migration file with one up/down step, configuring database connection, and running a migration to the latest version.

# Install globally npm install -g migo # Create a migration file (e.g., test.migo) echo '#1 CREATE TABLE books(id serial PRIMARY KEY); -- DROP TABLE books; ' > test.migo # Create config file tee migo.conf << EOF database=mydb user=dbuser host=localhost password=secret port=5432 EOF # Run migration to latest migo.js test.migo
Debug
Known issues
deprecatedThe package hasn't been updated since 2015 and no longer works with modern Node.js (>=12) due to deprecation of certain APIs.
fix
Migrate to a maintained tool like node-pg-migrate or db-migrate.
affects: >=0.1.4-1
gotchaMigration IDs must start at 1 and increment sequentially without gaps. Non-sequential IDs cause undefined behavior.
fix
Ensure migration IDs are consecutive integers starting from 1.
affects: *
gotchaThe tool asks for confirmation on rollback steps, but has no --force flag to skip it, making automation impossible.
fix
Write a wrapper script that echoes 'y' to stdin, e.g., `echo 'y' | migo.js test.migo 0`.
affects: *
breakingDatabase connection is configured via a separate config file (migo.conf) and defaults are not documented well; missing a file halts execution.
fix
Always create a migo.conf file in the working directory or use the -c option.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'pg'
The pg dependency is missing or not installed globally.
fix
Run `npm install -g pg` alongside migo or install migo locally and use npx.
Error: connect ECONNREFUSED 127.0.0.1:5432
PostgreSQL is not running or connection parameters in migo.conf are incorrect.
fix
Ensure PostgreSQL is started and migo.conf has correct host, port, user, password, database.
SyntaxError: Unexpected token # in JSON at position 0
Using npm's package.json or a JSON file instead of the .migo file format.
fix
Create a .migo file with the correct format as shown in the README.
Upgrade
Version history
0.1.4-1latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client driver used to execute migration SQL
Agent activity
6 hits · last 30 days
node
6
Resources
packagemigo
migo — npm install migo · libregistry