Preventing yourself from accidentally breaking production with Drush
For all the sites I maintain, I have at least a local and production environment. Some projects warrant a dev, qa, etc. as well, but for the purposes of this post, let's just assume you often run drush commands on local or development environments during development, and eventually run a similar command on production during a deployment.
What happens if, at some point, you are churning through some Drush commands, using aliases (e.g. drush @site.local break-all-the-things
to break things for testing), and you accidentally enter @site.prod
instead of @site.local
? Or what if you were doing something potentially disastrous, like deleting a database table locally so you can test a module install file, using drush sqlq
to run a query?
$ drush @site.prod break-all-the-things -y
Everything is broken! [sadpanda]