Created
December 23, 2009 04:59
-
-
Save jmeridth/262319 to your computer and use it in GitHub Desktop.
rails migrations post merge
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
#!/usr/bin/env ruby | |
`rake db:migrate && rake db:test:prepare` if `git diff HEAD^`.index("db/migrations") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice hook script!
Wouldn't it be safer to do :
Since the db/migrations text could potentially appear in an actual diff output while not being the file that was changed?
What about this?
This would make sure not to catch any files that is elsewhere in the tree but contains this sequence of characters. Am I too paranoid? :)
I like the fact that it won't run the db:test:prepare if the db:migrate fails. :)