Skip to content

Instantly share code, notes, and snippets.

@tmlangley
Created November 6, 2015 16:20
Show Gist options
  • Save tmlangley/ea6c88a90d2fa5729f04 to your computer and use it in GitHub Desktop.
Save tmlangley/ea6c88a90d2fa5729f04 to your computer and use it in GitHub Desktop.
sql-slurp
_sql-slurp () {
printf "This will overwrite the $2 database with the $1 database.\n"
printf "\n\t\t*** $1 -> $2 ***\n\n"
sleep 3s
read -p "Are you sure [Y/n]? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
drush $2 sql-drop -y
printf "\n"
drush $1 sql-dump | pv -br | drush $2 sql-cli -A
fi
printf "\n"
}
alias sql-slurp="_sql-slurp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment