[development] module upgrade

Dmitri Gaskin dmitrig01 at gmail.com
Sat Nov 1 17:51:18 UTC 2008

db_field_exists or db_column_exists (can't remember which)


On Nov 1, 2008, at 10:49 AM, Eric-Alexander Schaefer wrote:

> 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?
> Regards,
> Eric

More information about the development mailing list