Changeset 6528 for trunk/expressoMail1_2/setup
- Timestamp:
- 06/15/12 17:00:17 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/sandbox/2.4.1-3 merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/expressoMail1_2/setup/default_records.inc.php
r5988 r6528 1 1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Setup * 4 * http://www.egroupware.org * 5 * -------------------------------------------- * 6 * This program is free software; you can redistribute it and/or modify it * 7 * under the terms of the GNU General Public License as published by the * 8 * Free Software Foundation; either version 2 of the License, or (at your * 9 * option) any later version. * 10 \**************************************************************************/ 11 2 12 $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);"); 3 13 … … 15 25 $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoMail1_2', 'config_validate', 'hook_config_validate.inc.php')"); 16 26 17 27 /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner */ 28 $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 18 29 ?> -
trunk/expressoMail1_2/setup/setup.inc.php
r6255 r6528 13 13 $setup_info['expressoMail1_2']['name'] = 'expressoMail1_2'; 14 14 $setup_info['expressoMail1_2']['title'] = 'Expresso Mail'; 15 $setup_info['expressoMail1_2']['version'] = '2.4. 7';15 $setup_info['expressoMail1_2']['version'] = '2.4.8'; 16 16 $setup_info['expressoMail1_2']['app_order'] = 2; 17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressomail_contacts';18 17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_certificados'; 19 18 … … 22 21 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_message_followupflag'; 23 22 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_followupflag'; 23 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_dynamic_contact'; 24 24 25 25 … … 48 48 'versions' => Array('2.4') 49 49 ); 50 51 $setup_info['expressoMail1_2']['depends'][] = array( 52 'appname' => 'rest', 53 'versions' => Array('1.0') 54 ); 55 50 56 ?> -
trunk/expressoMail1_2/setup/tables_current.inc.php
r5981 r6528 10 10 \**************************************************************************/ 11 11 $phpgw_baseline = array( 12 ' phpgw_expressomail_contacts' => array(12 'expressomail_dynamic_contact' => array( 13 13 'fd' => array( 14 'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false), 15 'data' => array( 'type' => 'text') 14 'id' => array('type' => 'auto','nullable' => False), 15 'owner' => array('type' => 'int','precision' => '16','nullable' => False), 16 'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 17 'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 18 'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 19 'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 16 20 ), 17 'pk' => array('id _owner'),21 'pk' => array('id'), 18 22 'fk' => array(), 19 23 'ix' => array(), 20 24 'uc' => array() 21 25 ), 26 22 27 'phpgw_certificados' => array( 23 28 'fd' => array( -
trunk/expressoMail1_2/setup/tables_update.inc.php
r6255 r6528 267 267 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 268 268 } 269 269 270 $test[] = '2.4.7'; 271 function expressoMail1_2_upgrade2_4_7() { 272 $oProc = $GLOBALS['phpgw_setup']->oProc; 273 274 //Criando nova tabela de contatos dinamicos 275 $oProc->CreateTable('expressomail_dynamic_contact',array( 276 'fd' => array( 277 'id' => array('type' => 'auto','nullable' => False), 278 'owner' => array('type' => 'int','precision' => '16','nullable' => False), 279 'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 280 'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 281 'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 282 'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 283 ), 284 'pk' => array('id'), 285 'fk' => array(), 286 'ix' => array(), 287 'uc' => array() 288 ) 289 ); 290 291 /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner */ 292 $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 293 294 //Migra dados antigos para nova tabela 295 $oProc->query('SELECT * FROM phpgw_expressomail_contacts'); 296 $return = array(); 297 while($oProc->next_record()) 298 $return[$oProc->f('id_owner')] = $oProc->f('data'); 299 300 foreach ($return as $owner => &$value) { 301 $contacts = unserialize($value); 302 foreach ($contacts as &$contact) { 303 $info = explode('#', $contact['email']); 304 $oProc->query("INSERT INTO expressomail_dynamic_contact (owner, name ,mail , number_of_messages ,timestamp) values ('".$owner."', '".$info[0]."', '".$info[1]."', 1, '".$contact['timestamp']."');"); 305 } 306 } 307 308 //Deleta tabela antiga 309 $oProc->DropTable('phpgw_expressomail_contacts'); 310 311 /* Remove a restricao de quantidade de contatos recentes */ 312 $oProc->query("DELETE FROM phpgw_config WHERE config_app = 'expressoMail1_2' AND config_name = 'expressoMail_Number_of_dynamic_contacts'"); 313 314 $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.8'; 315 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 316 } 270 317 ?>
Note: See TracChangeset
for help on using the changeset viewer.