DrupalCon Sydney 2013: Managing Code and Configuration with Update Functions (and staying sane)
You're developing a Drupal site and you've whipped up a set of custom modules and content types to give your client exactly what they needed. Post-launch the client wants to add some additional fields to one of their content types. No problem.
The quickest solution would be to log in to the live site, and add the fields using the content type interface, right? Check. But don't forget to make the same change on staging, and don't mess it up, it has to be exactly the same! And make sure you tell Alice, the other developer, to make the change on her dev deployment. Our quick update has turned a bright and sunny future into a dark, dystopian nightmare.
Managing the change gracefully across dev, staging and production environments means using trusty old hook_update_N();. By making pragmatic use of update functions in your modules and install profile you can rest easy knowing that all your deployments are on the same page.
This talk is aimed at developers who are familiar with building custom modules, and have at least taken a glance at install profiles. The talk will cover general concepts and planning, and will provide beginner and intermediate-level examples of update functions in practice.
Choose life. Choose sanity. Choose update functions.
The quickest solution would be to log in to the live site, and add the fields using the content type interface, right? Check. But don't forget to make the same change on staging, and don't mess it up, it has to be exactly the same! And make sure you tell Alice, the other developer, to make the change on her dev deployment. Our quick update has turned a bright and sunny future into a dark, dystopian nightmare.
Managing the change gracefully across dev, staging and production environments means using trusty old hook_update_N();. By making pragmatic use of update functions in your modules and install profile you can rest easy knowing that all your deployments are on the same page.
This talk is aimed at developers who are familiar with building custom modules, and have at least taken a glance at install profiles. The talk will cover general concepts and planning, and will provide beginner and intermediate-level examples of update functions in practice.
Choose life. Choose sanity. Choose update functions.