November 2012

hook_schema or hook_update_N?

Drupal provides a very powerful and structured way of upgrading your sites and making DDIC changes. The two important hooks are
hook_schema() provides a structured, DB independent way of defining you table schema. When a new module is installed, the hook_schema() is automatically invoked (yes that's the case in Drupal 7, while in Drupal 6 it had to be explicitly used to create tables) and the tables are created.