1.0.11 • Published 6 years ago
mygrator v1.0.11
Mygrator
Mygrator is console tool for working with mysql migrations in node.js based projects.
It's written for node 8+ and depends on mysql
package.
Features:
- Config in files
- Migrations are stored in sql files
- Before applying each migration whole DB backup is done
- You can restore backuped DB versions in one line
- If version is placed in migration filename mygrator can resolve versioninf in auto mode. Or you can manually list them in config
- Backup and restore are based on
mysqldump
andmysql
. They work really fast
Warning: It's a very young project. No tests and warranties are provided with it. I will be really pleased for any PR and help.
Start
npm i -g mygrator
Create config template in working dir
mygrator setup
config is shipped with comments
List all migrations available
mygrator list all
List new migrations
mygrator list new
Upgrade DB to latest migration
mygrator upgrade
Upgrade DB to specific version
mygrator upgrade 1
# put your version number instead 1
Backup current DB
mygrator backup
Show info about current version
mygrator info
Restore specific version
mygrator restore 1