{"id":48533,"library":"migro","title":"Migro","description":"Lightweight database migration tool for Node.js supporting PostgreSQL and MySQL. Current stable version is 0.2.3, released as a minimal CLI tool with no runtime dependencies. It uses a JSON config file (.migrorc) and organizes migrations by version and database, with alphabetical sorting. Unlike more full-featured tools like Knex or Umzug, Migro is simple and focused, but has limited driver support (only PostgreSQL actively) and is not actively maintained. Compatible with Node >=10.","status":"maintenance","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/YBogomolov/migro","tags":["javascript","database","migration","db","migrate","schema","mysql","postgresql","postgres"],"install":[{"cmd":"npm install migro","lang":"bash","label":"npm"},{"cmd":"yarn add migro","lang":"bash","label":"yarn"},{"cmd":"pnpm add migro","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Migro is a CLI tool, not a library. Use via command line or npx.","symbol":"migro","correct":"npx migro up main"}],"quickstart":{"code":"npm install -g migro\n# create .migrorc\ncat > .migrorc <<EOF\n{\n  \"database\": {\n    \"main\": {\n      \"host\": \"localhost\",\n      \"port\": 5432,\n      \"user\": \"postgres\",\n      \"password\": \"\"\n    }\n  }\n}\nEOF\nexport PGPASSWORD='S3cur3P@55w0rd'\nmigro create-version main 0.0.1\nmigro create main create-users-table\n# Edit migrations/main/0.0.1/*.js\necho 'exports.up = (db) => db.query(`CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT)`)' > migrations/main/0.0.1/$(ls migrations/main/0.0.1/ | head -1)\nmigro up main","lang":"javascript","description":"Initialize a PostgreSQL database, create a version and migration, then apply it."},"warnings":[{"fix":"Use only PostgreSQL. Do not expect MySQL support.","message":"The 'driver' option defaults to 'pg' and only 'pg' is currently supported. MySQL is not implemented.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider alternatives like Umzug or Knex migrations.","message":"The package uses semistandard style and Travis CI, but the GitHub repo appears unmaintained since 2018.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure .migrorc is present and valid JSON.","message":"The config file must be named '.migrorc' and placed in the project root or specified via -w. No other formats supported.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pad versions: '0.0.09', '0.0.10'.","message":"Version directories are sorted alphabetically; using semantic versioning like '0.0.9' and '0.0.10' will sort incorrectly as strings.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Write exports.up = (db) => db.query('...') and exports.down = (db) => db.query('...').","message":"Migrations are JavaScript files that must export 'up' and 'down' functions. They receive a database connection object, not a knex instance.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.2.3':16 '10':75 'activ':66,70 'alphabet':42 'cli':21 'compat':72 'config':31 'current':12 'databas':3,40,77 'db':79 'depend':26 'driver':62 'featur':48 'file':32 'focus':58 'full':47 'full-featur':46 'javascript':76 'json':30 'knex':51 'lightweight':2 'like':50 'limit':61 'maintain':71 'migrat':4,36,78,80 'migro':1,54 'migrorc':33 'minim':20 'mysql':11,82 'node':74 'node.js':7 'organ':35 'postgr':84 'postgresql':9,65,83 'releas':17 'runtim':25 'schema':81 'simpl':56 'sort':43 'stabl':13 'support':8,63 'tool':5,22,49 'umzug':53 'unlik':44 'use':28 'version':14,38","created_at":"2026-06-07T16:57:08.790886+00:00","updated_at":"2026-06-07T16:57:08.790886+00:00","problems":[{"fix":"npm install pg","cause":"pg is not installed as a dependency; it's expected to be in your project.","error":"Error: Cannot find module 'pg'"},{"fix":"Start PostgreSQL or check .migrorc connection settings.","cause":"PostgreSQL is not running or host/port misconfigured.","error":"Error: connect ECONNREFUSED 127.0.0.1:5432"},{"fix":"Ensure the version exists: migro create-version main 0.0.1, then create migration.","cause":"Migration file path issue or missing version directory.","error":"Error: Cannot find module '/path/to/migrations/main/0.0.1/...js'"},{"fix":"npm install -g migro","cause":"Installed locally; use npx or install globally.","error":"migro: command not found"}],"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/YBogomolov/migro#readme","github":"https://github.com/YBogomolov/migro","docs":null,"changelog":null,"pypi":null,"npm":"migro","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}}