
Untitled
By: a guest on
May 16th, 2012 | syntax:
None | size: 0.53 KB | hits: 14 | expires: Never
#!/bin/bash
#
# git pull && run migratoins if need
dbtime=`stat -f "%m" db/migrate`
schema=`stat -f "%m" db/schema.rb`
git pull || exit
# If either schema or migrate dir has been changed, run migrations and test db prepare
# in general, we need not to check schema despite the case that existing migration has
# been changed. It, most likely, will cause problems anyway
if [[ $dbtime != `stat -f "%m" db/migrate` || $schema != `stat -f "%m" db/schema.rb` ]]; then
echo "Starting migrations"
bundle exec rake db:migrate db:test:prepare
fi