{"id":47739,"library":"g-migration","title":"g-migration","description":"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.","status":"maintenance","version":"2.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/wurde/g-migration","tags":["javascript","migration","db","express","generator"],"install":[{"cmd":"npm install g-migration","lang":"bash","label":"npm"},{"cmd":"yarn add g-migration","lang":"bash","label":"yarn"},{"cmd":"pnpm add g-migration","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a CLI tool, not a library. Use locally via npm scripts.","wrong":"npm install -g g-migration && g-migration create_table_users","symbol":"main (binary)","correct":"./node_modules/.bin/g_migration create_table_users"},{"note":"There is no exported JavaScript API. Do not attempt to require it.","wrong":"const migration = require('g-migration')","symbol":"Programmatic usage (if any)","correct":"Not applicable; the package provides only a CLI binary."},{"note":"Using the unqualified command may fail if the binary is not in PATH.","wrong":"\"g:migration\": \"g_migration\"","symbol":"npm script configuration","correct":"\"g:migration\": \"./node_modules/.bin/g_migration\""}],"quickstart":{"code":"// package.json\n{\n  \"scripts\": {\n    \"g:migration\": \"./node_modules/.bin/g_migration\"\n  }\n}\n\n// Terminal commands:\nnpm install g-migration --save-dev\nmkdir -p ./db/migrations\nnpm run g:migration create_table_users\n\n// This will generate a file like: ./db/migrations/20250321123456_create_table_users.js\n// with a basic template.","lang":"javascript","description":"Install the CLI, create migrations directory, and generate a timestamped migration file."},"warnings":[{"fix":"Write your own migration SQL/logic inside the generated files.","message":"No migration logic is provided; only file generation.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use './node_modules/.bin/g_migration' in npm scripts.","message":"The binary is named 'g_migration' (with an underscore) not 'g-migration'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Manually rename or move files after generation.","message":"The CLI does not support options like custom directory or filename prefixes.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Consider using alternatives like node-pg-migrate or umzug.","message":"No updates since Node.js 8 support; may not work with newer Node versions.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.2.0':18 'adapt':50 'basic':73 'boilerpl':74 'cadenc':31 'cli':6 'creat':33 'custom':48 'databas':11,49,83 'db':91 'driver':84 'e.g':57 'entir':78 'express':92 'featur':54 'file':13,36,70 'framework':56 'full':53 'full-featur':52 'g':2,62 'g-migrat':1,61 'generat':9,69,93 'infrequ':25 'intend':41 'intent':65 'javascript':89 'knex':58 'latest':21 'leav':75 'logic':77 'major':29 'migrat':3,12,35,55,63,76,90 'minim':5 'name':71 'node.js':15 'orm':86 'prefix':40 'project':16 'raw':45 'releas':23,30 'requir':88 'sequel':60 'simpl':66 'skeleton':34 'sql':46 'stabl':22 'timestamp':10,39 'tool':7 'unlik':51 'updat':26 'use':43 'user':81 'version':17","created_at":"2026-06-07T16:53:03.015258+00:00","updated_at":"2026-06-07T16:53:03.015258+00:00","problems":[{"fix":"Use './node_modules/.bin/g_migration' or add it to npm scripts.","cause":"Binary not in PATH or not installed correctly.","error":"command not found: g_migration"},{"fix":"Use it as a CLI tool via npm scripts; no API exists.","cause":"Attempting to require/import the package as a library.","error":"Cannot find module 'g-migration'"},{"fix":"Run 'mkdir -p ./db/migrations' before generating.","cause":"Migrations directory does not exist.","error":"ENOENT: no such file or directory, mkdir './db/migrations'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/wurde/g-migration#readme","github":"https://github.com/wurde/g-migration","docs":null,"changelog":null,"pypi":null,"npm":"g-migration","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}