Registry / database / sequelizemm

sequelizemm

JSON →
library1.3.0jsnpmunverified

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.

npm install sequelizemm
INSTALL
IMPORT
SIG · SEQUELIZEMM
S
sequelizemm
databasejavascriptv1.3.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.

makemigration
✓ import { makemigration } from 'sequelizemm'
✗ const makemigration = require('sequelizemm').makemigration
ESM import is preferred; CJS require works but must access the named export.
sequelizemm (CLI)
✓ npx sequelizemm
✗ sequelizemm
CLI is available globally via -g flag or via npx for local install.
Schema type
✓ import type { Schema } from 'sequelizemm'
TypeScript types are bundled; Schema type can be imported for programmatic use.

Shows how to set up the required sequelize.js file and run the CLI to generate a migration.

// Install globally or locally // npm i -g sequelizemm // or // npm install sequelizemm --save-dev // Create sequelize.js in project root: const { Sequelize } = require('sequelize'); const sequelize = new Sequelize('database', 'username', 'password', { host: 'localhost', dialect: 'postgres' // or mysql, sqlite, mssql }); // Initialize models and associations here module.exports = { sequelize }; // Run the CLI: // sequelizemm // Follow interactive prompts to create migration.
Debug
Known issues
gotchaThe sequelize.js file must export the Sequelize instance with a named export (default: 'sequelize') or use --name flag.
fix
Ensure your sequelize.js exports like: module.exports = { sequelize: sequelize } or use custom file/name via --file and --name.
affects: >=1.0.0
gotchaIf schema.json already exists from a previous run, the tool will compare against it. Deleting schema.json may cause unexpected behavior.
fix
Do not delete schema.json manually; let the tool manage it.
affects: >=1.0.0
deprecatedSequelize v5 support is deprecated; only v6 and v7 are supported in 1.3.0.
fix
Upgrade your project to Sequelize v6 or v7, or use an older version of sequelizemm.
affects: >=1.0.0 <1.3.0
gotchaThe CLI will look for sequelize.js in the current working directory unless --file is specified. If run from another directory, it may fail.
fix
Run the command from your project root or specify the full path with --file.
affects: >=1.0.0
breakingVersion 1.0.0 changed the import path from 'sequelizemm/lib/index' to just 'sequelizemm'.
fix
Update imports to use 'sequelizemm' directly.
affects: <1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'sequelize'
Sequelize is not installed as a dependency.
fix
Run 'npm install sequelize' in your project.
Error: No Sequelize instance found. Make sure you have a sequelize.js file in your project root or specify using --file
The CLI cannot find the Sequelize instance export.
fix
Create a sequelize.js file that exports a Sequelize instance, or use --file and --name flags.
TypeError: sequelize.queryInterface is not a function
The provided Sequelize instance is not initialized or is of wrong version.
fix
Ensure the sequelize instance is properly created with new Sequelize() and you are using a supported version (v6 or v7).
Error: ENOENT: no such file or directory, open './migrations/...'
The migrations directory does not exist.
fix
Create a 'migrations' folder in your project root, or configure migrations path in Sequelize.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
sequelizerequiredRequired to connect to database and generate migrations
Agent activity
15 hits · last 30 days
node
12
Resources
sequelizemm — npm install sequelizemm · libregistry