Created
November 6, 2015 16:20
-
-
Save tmlangley/ea6c88a90d2fa5729f04 to your computer and use it in GitHub Desktop.
sql-slurp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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