0.1.2 • Published 6 years ago
auto-rollback v0.1.2
auto-rollback
Custom post-checkout git hook to auto rollback new migrations on git checkout
git config is used to set rollback status
Backup existing post-checkout hook

Supported Apps
rails
Getting Started
Requirements
npm >= 5.2.0
bash
Usage
Enable auto migrate on git checkout
$ npx auto-rollback enableDisable auto migrate on git checkout
$ npx auto-rollback disableShow rollback status
$ npx auto-rollback statusHow auto rollback on rails work?
After git checkout:
- Execute
git checkout <previous-branch> db/migrate - Get migration versions
- Execute
bundle exec rake db:migrate:down VERSION=<version>for each version - Undo all changes in
db/migrate/anddb/schema.rb
The flow will be less complicated if pre-checkout git hook exist
Note
- Assumes all migration are reversible
bundle exec rake db:migrate:down VERSION=<version>fails silently
License
MIT