Registry / database / musafa

musafa

JSON →
library1.0.6jsnpmunverified

musafa is a simple NodeJS migration tool for PostgreSQL. Version 1.0.6 is the latest stable release. It provides a CLI to manage SQL migrations stored in a directory, with commands to migrate up, up all, down, down all, and show status. It uses a configuration file (.musafarc) for credentials and migration settings. It is minimal, without programmatic API, and designed for simple workflows compared to more complex tools like Knex or Flyway.

npm install musafa
INSTALL
IMPORT
SIG · MUSAFA
M
musafa
databasejavascriptv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Install musafa globally, initialize config, create a migration file, and apply it.

npm install -g musafa musafa init # edit .musafarc with your database credentials mkdir migrations echo 'CREATE TABLE users (id serial PRIMARY KEY, name text);' > migrations/001_create_users.sql musafa up
Debug
Known issues
gotchaConfiguration file must be in the current working directory; no programmatic API for customization.
fix
Ensure you run musafa commands from the directory containing .musafarc.
affects: >=1.0.0
gotchaMigrations are SQL files only; does not support JavaScript/TypeScript migrations.
fix
Write raw SQL in .sql files with prefixes like 001_, 002_, etc.
affects: >=1.0.0
gotchaRollback (down) relies on file prefix order, not a down migration; it cannot revert destructive changes.
fix
Use upall for forward only; manual SQL fixes for rollback.
affects: >=1.0.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '.musafarc'
Running musafa commands outside the project directory or missing configuration file.
fix
Navigate to the directory containing .musafarc or run `musafa init` to create one.
error: relation "musafa_migrations" does not exist
The migrations tracking table has not been created (running down before any up).
fix
Run `musafa up` first to create the table.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
packagemusafa
musafa — npm install musafa · libregistry