fixing older contacts with no cats: they use '' or '0' in the cat_id column, new ones use allways NULL

This commit is contained in:
Ralf Becker 2006-10-02 07:53:26 +00:00
parent 816e11629a
commit 4e86a27a98
2 changed files with 11 additions and 2 deletions

View File

@ -14,7 +14,7 @@
/* Basic information about this app */
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'eGroupWare API';
$setup_info['phpgwapi']['version'] = '1.3.012';
$setup_info['phpgwapi']['version'] = '1.3.013';
$setup_info['phpgwapi']['versions']['current_header'] = '1.28';
$setup_info['phpgwapi']['enable'] = 3;
$setup_info['phpgwapi']['app_order'] = 1;

View File

@ -650,4 +650,13 @@
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.3.012';
}
?>
$test[] = '1.3.012';
function phpgwapi_upgrade1_3_012()
{
// setting old contacts without cat to cat_id=NULL, they cat be '0' or ''
$GLOBALS['egw_setup']->db->query("UPDATE egw_addressbook SET cat_id=NULL WHERE cat_id IN ('','0')",__LINE__,__FILE__);
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.3.013';
}