[development] Choosing the N number for .install's hook_update_N

Earnie Boyd earnie at users.sourceforge.net
Mon Aug 4 19:29:26 UTC 2008


Quoting Earl Miles <merlin at logrus.com>:

> Earnie Boyd wrote:
>> Quoting Erik Stielstra <info at erikstielstra.nl>:
>>
>>> You find the policy here: 
>>> http://api.drupal.org/api/function/hook_update_N/7
>>>
>>
>> That doesn't answer the OP's question.  I find the numbering a bit 
>> limiting.  What happens if a module has version 10.  We should 
>> change N to read D-M-S where D is the Drupal version, M is the 
>> module version and S is the sequence number of changes with the dash 
>> (-) character being the delimiter of versions and sequence.  So 
>> mymod-7.x-2.1 upgrade would be mymod_update_7-2-1().
>
> So the difference between your setup and the setup in the policy is 
> that you include a dash -- which I'll mention isn't legal in function 
> names -- but is otherwise identical.
>
> Sorry, I don't think adding a character (and let's assume you meant _ 
> which is the only legal possibility) actually adds anything; what it 
> does do is break the database which requires the update number to be 
> a number.
>

Aside from the malformed function name 
s/mymod_update_7-2-1()/mymod_update_7_2_1(), the document states that 
the current function requires exactly one character for the Drupal 
version, exactly one character for the module version and exactly two 
characters for the sequence number.  This doesn't allow the module or 
Drupal to go to version 10.  Instead of exactly one, one and two we 
need to delimiterize the versions and sequence so that we can expand 
beyond it easily.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the development mailing list