Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Clear out your dev db (with protection from #epicfailure)
function cleardb {
DEVDB="`ruby -e "require 'yaml'; puts YAML.load('config/database.yml'))['development']['database']"`"
if [[ $DEVDB =~ "production" ]]; then
echo 'WATCHOUT! cleardb running against production dump';
bundle exec rake db:drop db:create db:schema:load db:seed && bundle exec rake db:test:clone;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment