Drupal: module update alter database table
Please give a little tour on how to write module updat开发者_StackOverflow社区es to provide altering of existing database tables. How to do this?
Sultan
See this guide on drupal.org. It is a good overview of how to do it.
Jurgason's answer is good - I'd just add that the hook_install function should contain all the updates as well because, when freshly installing a module, Drupal does not run the update functions, it assumes they've already been included in the schema.
精彩评论