0.1.2 • Published 4 years ago

auto-rollback v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

auto-rollback

Build Status

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

sample

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:

  1. Execute git checkout <previous-branch> db/migrate
  2. Get migration versions
  3. Execute bundle exec rake db:migrate:down VERSION=<version> for each version
  4. Undo all changes in db/migrate/ and db/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

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago