A database migration tool for MySQL that applies sequential SQL patch files (e.g., patch-0001-0002.sql) to manage schema changes. Current stable version: 0.7.0 (released March 2015). The package has seen no updates in years and relies on the deprecated mysql npm package (not mysql2). Key differentiator: users must supply their own mysql instance, avoiding dependency conflicts. However, the project is effectively abandoned with no releases since 2015, no TypeScript types, and no support for modern MySQL or async/await patterns. Not recommended for new projects.
npm install mysql-patcherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows the typical usage of mysql-patcher: requiring mysql and the patcher, setting options, and calling .patch() with a callback.
Switch to a migration tool that supports mysql2 or use the 'mysql' package at your own risk.
Run `npm install mysql` in your project.
Ensure every forward patch ends with: `UPDATE metadata SET value = '<new-level>' WHERE name = '<patchKey>';`
Add `reversePatchAllowed: true` to options if you need to rollback.
Consider alternatives like db-migrate, node-pg-migrate, or knex migrations.
Run `npm install mysql` and ensure the 'mysql' option in the options object is the require'd mysql module.
Make sure the migrations directory exists and the path is correct.
Set `reversePatchAllowed: true` in options.