From 8e55c897ab293821ae95bd08a4caaca17c41cc52 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 15 Sep 2010 13:34:01 +0000 Subject: [PATCH] Add index to improve import of contacts using a custom field as primary key --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_current.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index ecab65939e..85d764cd97 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -12,7 +12,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'eGroupWare API'; -$setup_info['phpgwapi']['version'] = '1.9.001'; +$setup_info['phpgwapi']['version'] = '1.9.002'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index 31f37baaad..ff4e6f125a 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -403,7 +403,7 @@ $phpgw_baseline = array( ), 'pk' => array('contact_id','contact_name'), 'fk' => array(), - 'ix' => array(), + 'ix' => array(array('contact_name','contact_value(32)')), 'uc' => array() ), 'egw_addressbook_lists' => array( diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 4110258f54..61f74c53c5 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -28,3 +28,16 @@ function phpgwapi_upgrade1_8_001() { return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.001'; } + +/** + * Add index to improve import of contacts using a custom field as primary key + * + * @return string + */ +function phpgwapi_upgrade1_9_001() +{ + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook_extra', + array('contact_name','contact_value(32)')); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.002'; +}