{"id":48536,"library":"migry","title":"Migry","description":"Migry is a simplistic MongoDB migration manager built specifically for Mongoose. Current stable version is 0.4.1, with no recent updates (last release likely 2019). It provides a CLI and programmatic API to create, list, and run migrations using JavaScript files that export an async function. Key differentiators: lightweight, no external dependencies besides Mongoose 5.x, and supports per-environment config with TLS options. Compared to alternatives like migrate-mongo, Migry has far fewer features and no active maintenance. Suitable for small projects that already use Mongoose and need a minimal migration runner. Use cautiously: peer dependency on Mongoose 5.x, no support for Mongoose 6+, and potential security risks from unverified npm package.","status":"maintenance","version":"0.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/alxolr/migry","tags":["javascript","database-migration","mongoose-migration","manager"],"install":[{"cmd":"npm install migry","lang":"bash","label":"npm"},{"cmd":"yarn add migry","lang":"bash","label":"yarn"},{"cmd":"pnpm add migry","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Mongoose is a peer dependency required at runtime for database connection and migration execution.","package":"mongoose","optional":false}],"imports":[{"note":"CommonJS only; ESM import may cause errors. Use require() for compatibility.","wrong":"import migry from 'migry';","symbol":"migry","correct":"const migry = require('migry');"},{"note":"The CLI constructor is exported as a property of the main module. Destructuring works, but direct require is safer if using older Node versions.","wrong":"const { CLI } = require('migry');","symbol":"migry.CLI","correct":"const CLI = require('migry').CLI;"},{"note":"Migrator is also a property export; ESM imports will fail. Use CommonJS.","wrong":"import { Migrator } from 'migry';","symbol":"migry.Migrator","correct":"const Migrator = require('migry').Migrator;"}],"quickstart":{"code":"// Step 1: Install dependencies\n// npm install migry mongoose\n\n// Step 2: Initialize migration folder\n// npx migry init\n\n// Step 3: Create a migration file\n// npx migry create add-users\n\n// Step 4: Edit the generated file (e.g., migrations/1630000000000-add-users.js)\n// migrations/1630000000000-add-users.js\nconst mongoose = require('mongoose');\n\nasync function migrate() {\n  const db = mongoose.connection.db;\n  await db.collection('users').insertOne({ name: 'test' });\n  console.log('Migration completed');\n}\n\nmodule.exports = migrate;\n\n// Step 5: Run migrations\n// npx migry run\n","lang":"javascript","description":"Shows basic setup and usage: install, init folder, create a migration, edit it, and run all pending migrations."},"warnings":[{"fix":"Downgrade Mongoose to 5.x or use a different migration tool that supports Mongoose 6+.","message":"Requires Mongoose 5.x, incompatible with Mongoose 6+ due to changes in connection API.","severity":"breaking","affected_versions":"<=0.4.1"},{"fix":"Consider migrating to actively maintained alternatives like migrate-mongo or mongodb-migrate.","message":"Package has not been updated since 2019; no support for newer Node.js versions or ESM.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Run commands in the directory where migrations/config.json exists.","message":"CLI commands must be run from the project root; does not respect custom migration directory paths in config.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Ensure migration files export an async function using module.exports = async function() { ... }.","message":"Migration files must export a single async function; any other export pattern will cause silent failures.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Install mongoose as a dependency: npm install mongoose@5","message":"Peer dependency mongoose is required; missing mongoose will cause runtime error when running migrations.","severity":"breaking","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.4.1':17 '2019':25 '5':55,102 '6':108 'activ':80 'alreadi':87 'altern':68 'api':32 'async':45 'besid':53 'built':9 'cautious':97 'cli':29 'compar':66 'config':62 'creat':34 'current':13 'databas':119 'database-migr':118 'depend':52,99 'differenti':48 'environ':61 'export':43 'extern':51 'far':75 'featur':77 'fewer':76 'file':41 'function':46 'javascript':40,117 'key':47 'last':22 'lightweight':49 'like':24,69 'list':35 'mainten':81 'manag':8,124 'migrat':7,38,71,94,120,123 'migrate-mongo':70 'migri':1,2,73 'minim':93 'mongo':72 'mongodb':6 'mongoos':12,54,89,101,107,122 'mongoose-migr':121 'need':91 'npm':115 'option':65 'packag':116 'peer':98 'per':60 'per-environ':59 'potenti':110 'programmat':31 'project':85 'provid':27 'recent':20 'releas':23 'risk':112 'run':37 'runner':95 'secur':111 'simplist':5 'small':84 'specif':10 'stabl':14 'suitabl':82 'support':58,105 'tls':64 'unverifi':114 'updat':21 'use':39,88,96 'version':15 'x':56,103","created_at":"2026-06-07T16:57:09.736913+00:00","updated_at":"2026-06-07T16:57:09.736913+00:00","problems":[{"fix":"Run 'npm install mongoose' to install the peer dependency.","cause":"Mongoose not installed or not in node_modules.","error":"Error: Cannot find module 'mongoose'"},{"fix":"const CLI = require('migry').CLI;","error":"TypeError: migry.CLI is not a constructor","correct":"Use require('migry').CLI instead of destructuring incorrectly."}],"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/alxolr/migry#readme","github":"https://github.com/alxolr/migry","docs":null,"changelog":null,"pypi":null,"npm":"migry","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}}