- Timestamp:
- 06/01/12 17:21:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.1-3/expressoMail1_2/setup/tables_update.inc.php
r6185 r6386 263 263 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 264 264 } 265 266 $test[] = '2.4.6'; 267 function expressoMail1_2_upgrade2_4_6() { 268 $oProc = $GLOBALS['phpgw_setup']->oProc; 269 270 //Criando nova tabela de contatos dinamicos 271 $oProc->CreateTable('expressomail_dynamic_contact',array( 272 'fd' => array( 273 'id' => array('type' => 'auto','nullable' => False), 274 'owner' => array('type' => 'int','precision' => '16','nullable' => False), 275 'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 276 'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 277 'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 278 ), 279 'pk' => array('id'), 280 'fk' => array(), 281 'ix' => array(), 282 'uc' => array() 283 ) 284 ); 285 286 //Migra dados antigos para nova tabela 287 $oProc->query('SELECT * FROM phpgw_expressomail_contacts'); 288 $return = array(); 289 while($oProc->next_record()) 290 $return[$oProc->f('id_owner')] = $oProc->f('data'); 291 292 foreach ($return as $owner => &$value) { 293 $contacts = unserialize($value); 294 foreach ($contacts as &$contact) { 295 $info = explode('#', $contact['email']); 296 $oProc->query("INSERT INTO expressomail_dynamic_contact (owner, name ,mail , timestamp) values ('".$owner."', '".$info[0]."', '".$info[1]."', '".$contact['timestamp']."');"); 297 } 298 } 299 //////////////////////////////////////////////////////////// 300 301 //Deleta tabela antiga 302 $oProc->DropTable('phpgw_expressomail_contacts'); 303 304 305 $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.7'; 306 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 307 } 265 308 266 309 ?>
Note: See TracChangeset
for help on using the changeset viewer.