I work on a team with multiple developers and we use hook_update_N functions in a "miscellaneous" module to make updates such as module or theme enabling/disabling, performing miscellaneous database updates, one-off variable assignments, and more. We often encounter conflicts when having code reviews, since multiple feature branch pull requests get approved around the same time, many with hook_update_N implementations that use the same number (N). The process of resolving the conflicts is slow because each conflict has to be resolved in series.

One option would be to have each developer create their own "glue" module and put their hook_update_N implementations in that module's .install file, but it seems wasteful to run multiple modules as a workaround for this problem.

Anyone have a good solution to avoiding or minimizing the conflicts?


A low tech solution I can think of would be to set up a wiki page where developers can "reserve" hook_update_N numbers for that site, and set up a procedure that everyone has to go to that page first and check for the next available number before starting work on an update hook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.