From f7892bcce2e2ce2e267ebfc349230251e1c965ec Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 30 Mar 2005 07:36:17 +0000 Subject: [PATCH] setting egw_api_content_history.sync_{added|modified|deleted} to NOTNULL, as the code only sets one timestamp (mysql does not care about NOTNULL, but eg. postgres does) --- phpgwapi/setup/setup.inc.php | 3 ++- phpgwapi/setup/tables_current.inc.php | 18 +++++++++--------- phpgwapi/setup/tables_update.inc.php | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index d8ec75f0a8..39fe3189b3 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -14,7 +14,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '1.0.1.004'; + $setup_info['phpgwapi']['version'] = '1.0.1.005'; $setup_info['phpgwapi']['versions']['current_header'] = '1.28'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; @@ -59,3 +59,4 @@ + diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index 79a465ea4a..65e008143d 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -371,18 +371,18 @@ ), 'egw_api_content_history' => array( 'fd' => array( - 'sync_appname' => array('type' => 'varchar','precision' => '60','nullable' => False), + 'sync_appname' => array('type' => 'varchar','precision' => '60','nullable' => False), 'sync_contentid' => array('type' => 'varchar','precision' => '60','nullable' => False), - 'sync_added' => array('type' => 'timestamp', 'nullable' => False), - 'sync_modified' => array('type' => 'timestamp', 'nullable' => False), - 'sync_deleted' => array('type' => 'timestamp', 'nullable' => False), - 'sync_id' => array('type' => 'auto','nullable' => False), - 'sync_guid' => array('type' => 'varchar','precision' => '120','nullable' => False), - 'sync_changedby' => array('type' => 'int','precision' => '4','nullable' => False), + 'sync_added' => array('type' => 'timestamp'), + 'sync_modified' => array('type' => 'timestamp'), + 'sync_deleted' => array('type' => 'timestamp'), + 'sync_id' => array('type' => 'auto','nullable' => False), + 'sync_guid' => array('type' => 'varchar','precision' => '120','nullable' => False), + 'sync_changedby' => array('type' => 'int','precision' => '4','nullable' => False) ), 'pk' => array('sync_id'), 'fk' => array(), - 'ix' => array(array('sync_appname','sync_contentid'),'sync_added','sync_modified','sync_deleted','sync_guid','sync_changedby'), + 'ix' => array('sync_added','sync_modified','sync_deleted','sync_guid','sync_changedby',array('sync_appname','sync_contentid')), 'uc' => array() - ), + ) ); diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 11585ac740..5a44255a4d 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -161,3 +161,21 @@ $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.1.004'; return $GLOBALS['setup_info']['phpgwapi']['currentver']; } + + $test[] = '1.0.1.004'; + function phpgwapi_upgrade1_0_1_004() + { + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_api_content_history','sync_added',array( + 'type' => 'timestamp' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_api_content_history','sync_modified',array( + 'type' => 'timestamp' + )); + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_api_content_history','sync_deleted',array( + 'type' => 'timestamp' + )); + + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.1.005'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } +?>