auto-rollback
v0.1.2
Published
[![Build Status](https://travis-ci.org/darwintantuco/auto-rollback.svg?branch=master)](https://travis-ci.org/darwintantuco/auto-rollback)
Downloads
9
Readme
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 enable
Disable auto migrate on git checkout
$ npx auto-rollback disable
Show rollback status
$ npx auto-rollback status
How 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