A module for handling database migrations using raw SQL scripts with Sequelize. This package allows you to manage versioned SQL script executions for MySQL and PostgreSQL. It creates a tracking table (`sph_script_execution`) to record which scripts have been applied, ensuring idempotent upgrades. The module takes a Sequelize instance and a module configuration including version, script directory, and per-dialect upgrade scripts. Designed for simple, file-based migration workflows. Version 1.0.1 is the latest stable release. Alternatives like Umzug or Sequelize's built-in migration CLI offer more features, but this package provides a lightweight approach for projects that prefer pure SQL. Low maintenance cadence.
npm install sequelize-migrationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Sequelize instance, initializes the migration module, adds an upgrade script, and runs pending migrations.
Always include entries for every dialect you support even if no scripts exist: dialects: { mysql: [], postgres: [] }Use a unique identifier for the 'module' field, e.g., 'my-org/my-app' or a UUID.
If you need SQLite or MSSQL, consider alternatives like Umzug.
Evaluate switching to actively maintained migration tools like Umzug, Sequelize CLI migrations, or Knex.
Ensure the script directory structure matches expectations: [dir]/[dialect]/[filename]. Test with an absolute path if relative fails.
Run 'npm install sequelize-migration --save' to add it as a dependency.
Use correct CommonJS require: const SequelizeMigration = require('sequelize-migration');Switch to require() instead of import.
Create instance: const migration = new SequelizeMigration(sequelize);