Simple library to deal with migrations.
Define the following env variables:
MIGRATIONS_DIR={{directory to read and write migrations}}
MYSQL_HOST={{host}}
MYSQL_PASSWORD={{password}}
MYSQL_PORT={{port}}
MYSQL_USER={{user}}
MYSQL_DATABASE={{database}}
Next run init script to prepare folder structure:
npx mysql-migrations init
After initialized, the following commands are available:
npx mysql-migrations create {{nameOfTheMigration}}
npx mysql-migrations run
npx mysql-migrations revert