In Chapter 2, Keeping Database Configuration and Code Together, we introduced the update path as a list of steps to update a database so that it gets in sync with the exported configuration in code. Then, in Chapter 4, Error Handling and Debugging, we made the update path more flexible by wrapping it in a Drush command and taking advantage of Drush's command hooks in order to perform steps before and after it runs. In this chapter, we will go one step further by implementing the following improvements:
Make sure that the
registry-rebuild
andfeatures-revert-all
commands are available.Add an example in the command definition using a site alias.
Implement error handling by inspecting the returned status from each command. If a command fails, we will stop the process immediately.