Update hooks not being run when module enabled - chicken and egg problem I've created a custom module to be used for deploying configuration updates like enabaling modules, reverting features, executing db queries, etc...

The module initially has an empty .module file, a .info file and a .install file with three hook_update_n functions.

When I enable the module, the schema version is set to the last "n" value of the update hooks, but the functions inside those hooks aren't executed.

What's the proper way to enable a "utility" module like this during deployment, and still run the update hooks via update.php?

Should the functions go in a hook_install instead?

Seems like a "who's on first" type problem.

Thank you.
A module with an install file gets run at install, for an example if you install/enable a module with one hook_install and three hook_update_ only the hook_install will be ran.

The best way to do what you want to do is create a module like you want, with a empty hook_install then just keep adding hook_update_ functions as you need to do more stuff, then when you are done run update.php to run all the hooks.

It may also be a good idea to separate the types of stuff you want to do into groups (like create new items, and add them to the database, then another hook could be delete x and y, and another could be rename a and b) and add them as hook_update_ so for example if you need to run something more then once for an example or maybe down the road, you could just call update.php and run that specific hook_update_ function (if you for example wanted to run delete x and y more then once, you can).