{"id":49329,"library":"sequelizemm","title":"Sequelize Make Migration","description":"Sequelize Make Migration (sequelizemm) is a CLI tool for generating Sequelize migration files interactively. Version 1.3.0 supports Sequelize v6 & v7, ESM and CJS, and automatically creates up/down migrations with constraints and transaction support. It uses a schema.json file to track model changes. Unlike manual migration creation, it provides an interactive prompt and synchronizes database schema with current models. Released under MIT license.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/hasinoorit/sequelizemm","tags":["javascript","Sequelize","Migration","Orm","CLI","typescript"],"install":[{"cmd":"npm install sequelizemm","lang":"bash","label":"npm"},{"cmd":"yarn add sequelizemm","lang":"bash","label":"yarn"},{"cmd":"pnpm add sequelizemm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to connect to database and generate migrations","package":"sequelize","optional":false}],"imports":[{"note":"ESM import is preferred; CJS require works but must access the named export.","wrong":"const makemigration = require('sequelizemm').makemigration","symbol":"makemigration","correct":"import { makemigration } from 'sequelizemm'"},{"note":"CLI is available globally via -g flag or via npx for local install.","wrong":"sequelizemm","symbol":"sequelizemm (CLI)","correct":"npx sequelizemm"},{"note":"TypeScript types are bundled; Schema type can be imported for programmatic use.","wrong":"","symbol":"Schema type","correct":"import type { Schema } from 'sequelizemm'"}],"quickstart":{"code":"// Install globally or locally\n// npm i -g sequelizemm\n// or\n// npm install sequelizemm --save-dev\n\n// Create sequelize.js in project root:\nconst { Sequelize } = require('sequelize');\nconst sequelize = new Sequelize('database', 'username', 'password', {\n  host: 'localhost',\n  dialect: 'postgres' // or mysql, sqlite, mssql\n});\n// Initialize models and associations here\nmodule.exports = { sequelize };\n\n// Run the CLI:\n// sequelizemm\n// Follow interactive prompts to create migration.","lang":"typescript","description":"Shows how to set up the required sequelize.js file and run the CLI to generate a migration."},"warnings":[{"fix":"Ensure your sequelize.js exports like: module.exports = { sequelize: sequelize } or use custom file/name via --file and --name.","message":"The sequelize.js file must export the Sequelize instance with a named export (default: 'sequelize') or use --name flag.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not delete schema.json manually; let the tool manage it.","message":"If schema.json already exists from a previous run, the tool will compare against it. Deleting schema.json may cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade your project to Sequelize v6 or v7, or use an older version of sequelizemm.","message":"Sequelize v5 support is deprecated; only v6 and v7 are supported in 1.3.0.","severity":"deprecated","affected_versions":">=1.0.0 <1.3.0"},{"fix":"Run the command from your project root or specify the full path with --file.","message":"The CLI will look for sequelize.js in the current working directory unless --file is specified. If run from another directory, it may fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update imports to use 'sequelizemm' directly.","message":"Version 1.0.0 changed the import path from 'sequelizemm/lib/index' to just 'sequelizemm'.","severity":"breaking","affected_versions":"<1.0.0"}],"env_vars":null,"search_vec":"'1.3.0':19 'automat':28 'chang':45 'cjs':26 'cli':10,70 'constraint':33 'creat':29 'creation':49 'current':60 'databas':57 'esm':24 'file':16,41 'generat':13 'interact':17,53 'javascript':66 'licens':65 'make':2,5 'manual':47 'migrat':3,6,15,31,48,68 'mit':64 'model':44,61 'orm':69 'prompt':54 'provid':51 'releas':62 'schema':58 'schema.json':40 'sequel':1,4,14,21,67 'sequelizemm':7 'support':20,36 'synchron':56 'tool':11 'track':43 'transact':35 'typescript':71 'unlik':46 'up/down':30 'use':38 'v6':22 'v7':23 'version':18","created_at":"2026-06-07T17:01:12.242770+00:00","updated_at":"2026-06-07T17:01:12.242770+00:00","problems":[{"fix":"Run 'npm install sequelize' in your project.","cause":"Sequelize is not installed as a dependency.","error":"Error: Cannot find module 'sequelize'"},{"fix":"Create a sequelize.js file that exports a Sequelize instance, or use --file and --name flags.","cause":"The CLI cannot find the Sequelize instance export.","error":"Error: No Sequelize instance found. Make sure you have a sequelize.js file in your project root or specify using --file"},{"fix":"Ensure the sequelize instance is properly created with new Sequelize() and you are using a supported version (v6 or v7).","cause":"The provided Sequelize instance is not initialized or is of wrong version.","error":"TypeError: sequelize.queryInterface is not a function"},{"fix":"Create a 'migrations' folder in your project root, or configure migrations path in Sequelize.","cause":"The migrations directory does not exist.","error":"Error: ENOENT: no such file or directory, open './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/hasinoorit/sequelizemm#readme","github":"https://github.com/hasinoorit/sequelizemm","docs":null,"changelog":null,"pypi":null,"npm":"sequelizemm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"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}}