Sequelize Migration 2 is a Node.js library for managing database migrations using raw SQL scripts in Sequelize projects. Version 2.0.0 focuses on MySQL and PostgreSQL, with untested support for other dialects. It creates a `db_migration` table to track applied migrations and supports modular script directories per dialect. Compared to other tools, it relies purely on SQL files rather than JavaScript-based migrations, and the release cadence is low, with no major updates since 2020. Key differentiators include simplicity, dialect-specific folders, and optional MD5 checksum verification planned for future releases.
npm install sequelize-migration-2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Quickstart demonstrating installation, configuring Sequelize & SequelizeMigration, adding a migration module, and syncing.
Use a descriptive and unique name for each module, e.g., 'users' or 'orders'.
Ensure your migration scripts are placed in dialect-specific subdirectories under the module directory.
Avoid direct modification of the `db_migration` table; use the library's sync method.
Use `new SequelizeMigration(sequelize)` instead of `new SequelizeMigration({ sequelize })`.Run `npm install sequelize-migration-2` or `yarn add sequelize-migration-2`.
Use CommonJS require: `const SequelizeMigration = require('sequelize-migration-2');`Create a Sequelize instance first: `const sequelize = new Sequelize(...);` then pass it to `new SequelizeMigration(sequelize);`
Call `migration.addModule({ name: 'my-module', dir: 'path/to/scripts' });` before `migration.sync();`