[development] Writing updates for minor releases

Karoly Negyesi karoly at negyesi.net
Wed Oct 4 07:43:50 UTC 2006


I closed http://drupal.org/node/64212 for good.

To sum up, if you are writing a core patch which adds an update to a minor  
release, then you need to duplicate that in the HEAD section (which has a  
different numbering) and do it in such a way that the second update won't  
generate an error.

To achieve this, use DROP IF EXSITS for indexes (both databases), in the  
unlikely case you are adding a field, check for its existence first  
through SELECT * FROM, db_fetch_array, isset. ALTERs need no special  
taking care of.

I do not think there will be a very complex update in a minor revision  
ever but if there will be, we can solve that when the need arrives. Note  
that the above did not divulge into introspection which is available for  
complex cases.



More information about the development mailing list