Registry / database / g-migration

g-migration

JSON →
library2.2.0jsnpmunverified

A minimal CLI tool to generate timestamped database migration files for Node.js projects. Version 2.2.0 is the latest stable release, with infrequent updates and no major release cadence. It creates skeleton migration files with a timestamp prefix, intended for use with raw SQL or custom database adapters. Unlike full-featured migration frameworks (e.g., Knex or Sequelize), g-migration is intentionally simple: it only generates file names and basic boilerplate, leaving migration logic entirely to the user. No database driver or ORM is required.

npm install g-migration
INSTALL
IMPORT
SIG · G-MIGRATION
G
g-migration
databasejavascriptv2.2.0
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.

main (binary)
✓ ./node_modules/.bin/g_migration create_table_users
✗ npm install -g g-migration && g-migration create_table_users
This is a CLI tool, not a library. Use locally via npm scripts.
Programmatic usage (if any)
✓ Not applicable; the package provides only a CLI binary.
✗ const migration = require('g-migration')
There is no exported JavaScript API. Do not attempt to require it.
npm script configuration
✓ "g:migration": "./node_modules/.bin/g_migration"
✗ "g:migration": "g_migration"
Using the unqualified command may fail if the binary is not in PATH.

Install the CLI, create migrations directory, and generate a timestamped migration file.

// package.json { "scripts": { "g:migration": "./node_modules/.bin/g_migration" } } // Terminal commands: npm install g-migration --save-dev mkdir -p ./db/migrations npm run g:migration create_table_users // This will generate a file like: ./db/migrations/20250321123456_create_table_users.js // with a basic template.
Debug
Known issues
gotchaNo migration logic is provided; only file generation.
fix
Write your own migration SQL/logic inside the generated files.
affects: >=0.0.0
gotchaThe binary is named 'g_migration' (with an underscore) not 'g-migration'.
fix
Use './node_modules/.bin/g_migration' in npm scripts.
affects: >=0.0.0
gotchaThe CLI does not support options like custom directory or filename prefixes.
fix
Manually rename or move files after generation.
affects: >=2.0.0
deprecatedNo updates since Node.js 8 support; may not work with newer Node versions.
fix
Consider using alternatives like node-pg-migrate or umzug.
affects: >=2.0.0
Errors
Common errors & fixes
command not found: g_migration
Binary not in PATH or not installed correctly.
fix
Use './node_modules/.bin/g_migration' or add it to npm scripts.
Cannot find module 'g-migration'
Attempting to require/import the package as a library.
fix
Use it as a CLI tool via npm scripts; no API exists.
ENOENT: no such file or directory, mkdir './db/migrations'
Migrations directory does not exist.
fix
Run 'mkdir -p ./db/migrations' before generating.
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
g-migration — npm install g-migration · libregistry