Sequelize Migration Generator Helper is a CLI tool (v0.0.4) that automatically generates Sequelize migration files by comparing your current model definitions against a previous snapshot, supporting createTable, removeTable, addColumn, modifyColumn, and removeColumn operations. It works alongside sequelize-cli and requires a custom init script that exports an async function returning a configured Sequelize instance. The tool is TypeScript-friendly (ships types) but currently only accepts JavaScript files for the init script, requiring compilation before use. Designed for Node.js >16.0.0, it reduces boilerplate for Sequelize projects but is early-stage (limited community adoption).
npm install sequelize-mtm-cliNo compatibility data collected yet for this library.
Installs the CLI, creates a minimal Sequelize init script, sets up npm scripts to generate and run migrations, then executes them.
Compile TypeScript to JS first, e.g., using tsc, and point -s to the compiled output.
Ensure module.exports = async () => { ... return sequelize; } is used.Commit generated migrations to version control and only regenerate when models change.
Stick with sequelize-cli unless the documentation updates.
Ensure the path is relative to the current working directory and the file exists. Use absolute paths if needed.
Verify that the exported function returns a Sequelize instance after calling authenticate().
Delete the previous migration folder contents before regenerating, or use a version control workflow.
Use require/module.exports or set 'type': 'module' in package.json (but then sequelize-cli may also need ESM support).