Created
September 20, 2013 16:19
-
-
Save kbaird/6640077 to your computer and use it in GitHub Desktop.
Shell script for reverting migrations found in a dev branch and not found in master branch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git diff --name-only master db/migrate/ | sed "s/migrate\//migrate\n/" | grep -v migrate | sed "s/\_/\n/" | grep -v rb | xargs -I vnum rake db:migrate:down VERSION=vnum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment