public

Runs rails db migrations if changes exist in changes

  • Download Gist
run_db_migrations_if_changes_present.rb
Ruby
1 2
#!/usr/bin/env ruby
`rake db:migrate && rake db:test:prepare` if `git diff --name-only HEAD@{1} HEAD`.index("db/migrations)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.