[development] module upgrade

Eric-Alexander Schaefer eric.schaefer at eas-consulting.de
Sat Nov 1 17:49:02 UTC 2008

Hi List,

for some reason the scheduler.module recorded the time for publish and 
unpublish in local time of the user with an additional timezone column 
for translation to utc or whatever. Some time ago I changed it, so that 
it would store the times in utc and removed the timezone column. This 
was done for both 5.x and 6.x. Now when upgrading from a current 5.x 
release to 6.x scheduler_update_6100() gets called and tries to adjust 
already stored times by their respective timezone values and then 
removes the timezone column.

function scheduler_update_6100() {
   $ret[] = update_sql("UPDATE {scheduler} SET 
publish_on=publish_on-timezone WHERE publish_on<>0");
   $ret[] = update_sql("UPDATE {scheduler} SET 
unpublish_on=unpublish_on-timezone WHERE unpublish_on<>0");
   $ret[] = update_sql("ALTER TABLE {scheduler} DROP COLUMN timezone");
   return $ret;

Since the timezone column does not exists in current 5.x releases the 
update fails. To avoid it I would check for the existence of the 
timezone column. But: How?


More information about the development mailing list