1.0.11 • Published 8 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
mysqldumpandmysql. 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 mygratorCreate config template in working dir
mygrator setupconfig is shipped with comments
List all migrations available
mygrator list allList new migrations
mygrator list newUpgrade DB to latest migration
mygrator upgradeUpgrade DB to specific version
mygrator upgrade 1
# put your version number instead 1Backup current DB
mygrator backupShow info about current version
mygrator infoRestore specific version
mygrator restore 1