From 4323d52fd07f9983ee06d95baf560f5b600601d3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 26 Aug 2015 14:14:20 +0000 Subject: [PATCH] * PostgreSQL: repairing/creating missing indexes --- phpgwapi/setup/setup.inc.php | 3 +-- phpgwapi/setup/tables_update.inc.php | 30 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 1a67fa23fd..a9d1b9b72d 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'] = '14.3.901'; +$setup_info['phpgwapi']['version'] = '14.3.902'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; @@ -36,7 +36,6 @@ $setup_info['phpgwapi']['tables'][] = 'egw_nextid'; $setup_info['phpgwapi']['tables'][] = 'egw_categories'; $setup_info['phpgwapi']['tables'][] = 'egw_history_log'; $setup_info['phpgwapi']['tables'][] = 'egw_async'; -$setup_info['phpgwapi']['tables'][] = 'egw_api_content_history'; $setup_info['phpgwapi']['tables'][] = 'egw_links'; $setup_info['phpgwapi']['tables'][] = 'egw_addressbook'; $setup_info['phpgwapi']['tables'][] = 'egw_addressbook_extra'; diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 05ed6173dd..c855d4d3fb 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -840,6 +840,22 @@ function phpgwapi_upgrade14_3_002() return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.003'; } +/** + * Check and if necessary fix indexes, they have been completly lost on PostgreSQL with previous updates + * + * @return string + */ +function phpgwapi_upgrade14_3_003() +{ + $GLOBALS['run-from-upgrade14_3_003'] = true; + + if ($GLOBALS['egw_setup']->db->Type == 'pgsql') + { + $GLOBALS['egw_setup']->oProc->CheckCreateIndexes(); + } + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.004'; +} + /** * Updates on the way to 15.1 */ @@ -849,7 +865,7 @@ function phpgwapi_upgrade14_3_002() * * @return string */ -function phpgwapi_upgrade14_3_003() +function phpgwapi_upgrade14_3_004() { $GLOBALS['egw_setup']->oProc->DropTable('egw_api_content_history'); @@ -867,3 +883,15 @@ function phpgwapi_upgrade14_3_900() } return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.901'; } + +/** + * Run 14.3.003 upgrade for everyone who was already on 14.3.900 + */ +function phpgwapi_upgrade14_3_901() +{ + if (empty($GLOBALS['run-from-upgrade14_3_003'])) + { + phpgwapi_upgrade14_3_003(); + } + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.902'; +}