Registry / database / migurt

migurt

JSON →
library3.0.9jsnpmunverified

Migurt is a PostgreSQL database migration tool (v3.0.9) that lets you write migrations and seeds in plain SQL. It creates timestamped up/down SQL files and tracks applied migrations in database tables. Unlike ORM-based migration tools, Migurt is minimal and database-native, supporting only PostgreSQL. It has a CLI for creating, running, and reverting migrations and seeds, with configuration via environment variables. Maintenance is sporadic.

npm install migurt
INSTALL
IMPORT
SIG · MIGURT
M
migurt
databasejavascriptv3.0.9
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.

migurt CLI
npx migurt migrate --number 1
require('migurt')
Migurt is a CLI tool, not a library. No imports are needed; use npx or global install.

Global install, set DATABASE_URL, create a migration, then run it. Works only with PostgreSQL.

npm i -g migurt export DATABASE_URL=postgres://user:pass@localhost/mydb migurt create-migration --name add_users_table # edit ./db/migrations/up/<timestamp>_add_users_table.sql and ./db/migrations/down/<timestamp>_add_users_table.sql migurt migrate --number 1
Debug
Known issues
gotchaDATABASE_URL environment variable is required. Missing it will cause connection failure.
fix
Set DATABASE_URL in .env or environment, e.g., DATABASE_URL=postgres://user:pass@localhost/mydb
affects: >=0.0.0
gotchaOnly PostgreSQL is supported; MySQL is not implemented despite TODO.
fix
Use a different tool for MySQL (e.g., db-migrate, node-pg-migrate).
affects: >=0.0.0
deprecatedMigurt appears unmaintained; last commit was years ago. It may not work with newer Node versions.
fix
Consider alternatives like node-pg-migrate or db-migrate-pg if you need active support.
affects: >=0.0.0
gotchaThe --number flag is required for migrate, seed, and revert commands. Omitting it prints help.
fix
Always provide --number, e.g., migurt migrate --number 1
affects: >=0.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:5432
PostgreSQL not running or DATABASE_URL points to wrong host/port.
fix
Start PostgreSQL or update DATABASE_URL to correct connection string.
Error: Cannot find module 'dotenv'
dotenv is an optional dependency? Or missing if project fails.
fix
Install dotenv: npm install dotenv
migurt: command not found
Installed locally but not globally; PATH not set.
fix
Install globally: npm i -g migurt, or use npx migurt.
Upgrade
Version history
3.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
packagemigurt
migurt — npm install migurt · libregistry