A promise-based MySQL migration utility for Node.js, version 0.3.1. It provides a simple API to run SQL migration scripts automatically on application startup. The package enforces a naming convention (V<version>__<name>.sql) and supports single or multiple statements per file depending on connection settings. Compared to alternatives like db-migrate or knex, it is minimal and focused, but lacks CLI tools, rollback support, and active maintenance.
npm install mysql-migration-promiseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a MySQL connection, runs migrations from the ./migrations folder, and closes the connection.
Either enable multipleStatements: true in the connection config, or split migration scripts into separate files with single statements.
Rename migration files to match the required pattern.
Use __dirname + '/migrations' to ensure the path is relative to the calling file.
Manually revert changes or use a more feature-rich migration tool if rollback is needed.
Run: npm install mysql-migration-promise
Use: const mysqlMigration = require('mysql-migration-promise');Rename the file to something like V1__init.sql.