MySQL Upgrade
A simple MySQL database upgrade module based on plain SQL files. For developers who don't use an ORM like Sequelize, but still want to have a database.sync();
functionality.
npm install --save mysql-upgrade
Requirements
This module only works with Node 7.6 or later (because of native support for async/await
).
How to use
const upgrade = require('mysql-upgrade')
const upgradeConfig = {
mysql: {
host: 'localhost',
user: 'root',
password: '',
database: ''
},
verbose: true,
table: 'my_upgrade_version',
path: './my-sql-files'
};
upgrade(upgradeConfig).then(function(upgraded) {
console.log(upgraded);
})
Issues
If you encounter any bugs or problems with this module, please sumit an issue. Pull requests with bugfixes are of course welcome.