public
Created

Clear out your dev db (with protection from #epicfailure)

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8
function cleardb {
DEVDB="`ruby -e "require 'yaml'; puts YAML.load(File.open('config/database.yml'))['development']['database']"`"
if [[ $DEVDB =~ "production" ]]; then
echo 'WATCHOUT! cleardb running against production dump';
else
bundle exec rake db:drop db:create db:schema:load db:seed && bundle exec rake db:test:clone;
fi
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.