From e5dc267823208f38e67fcb9f768a1dc76f55070a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 18 Jun 2018 11:33:21 +0200 Subject: [PATCH] change history-log values to longtext (was text=64k) also backport 17.1.002 update (sharing-email in history) without code changes, only schema --- api/setup/setup.inc.php | 2 +- api/setup/tables_current.inc.php | 7 ++++--- api/setup/tables_update.inc.php | 32 +++++++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index 706787d134..00d3a3c2f0 100644 --- a/api/setup/setup.inc.php +++ b/api/setup/setup.inc.php @@ -11,7 +11,7 @@ /* Basic information about this app */ $setup_info['api']['name'] = 'api'; $setup_info['api']['title'] = 'EGroupware API'; -$setup_info['api']['version'] = '17.1.001'; +$setup_info['api']['version'] = '17.1.003'; $setup_info['api']['versions']['current_header'] = '1.29'; // maintenance release in sync with changelog in doc/rpm-build/debian.changes $setup_info['api']['versions']['maintenance_release'] = '17.1.20180523'; diff --git a/api/setup/tables_current.inc.php b/api/setup/tables_current.inc.php index 62788f5757..95f2db1d5f 100644 --- a/api/setup/tables_current.inc.php +++ b/api/setup/tables_current.inc.php @@ -151,10 +151,11 @@ $phpgw_baseline = array( 'history_appname' => array('type' => 'ascii','precision' => '16','nullable' => False), 'history_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False), 'history_status' => array('type' => 'varchar','precision' => '32','nullable' => False), - 'history_new_value' => array('type' => 'text','nullable' => False), + 'history_new_value' => array('type' => 'longtext','nullable' => False), 'history_timestamp' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), - 'history_old_value' => array('type' => 'text','nullable' => False), - 'sessionid' => array('type' => 'int','precision' => '4','comment' => 'primary key to egw_access_log') + 'history_old_value' => array('type' => 'longtext','nullable' => False), + 'sessionid' => array('type' => 'int','precision' => '4','comment' => 'primary key to egw_access_log'), + 'share_email' => array('type' => 'varchar','precision' => '4096','comment' => 'email addresses of share who made the change, comma seperated') ), 'pk' => array('history_id'), 'fk' => array(), diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index bbac100e98..eeb7639a89 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -422,4 +422,34 @@ function api_upgrade17_1() )); return $GLOBALS['setup_info']['api']['currentver'] = '17.1.001'; -} \ No newline at end of file +} + +/** + * Add field to history log for share email address, if available + */ +function api_upgrade17_1_001() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_history_log','share_email',array( + 'type' => 'varchar', + 'precision' => '4096', + 'default' => NULL, + 'nullable' => True, + 'comment' => 'email addresses of share who made the change, comma seperated' + )); + return $GLOBALS['setup_info']['api']['currentver'] = '17.1.002'; +} + + +function api_upgrade17_1_002() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_history_log','history_new_value',array( + 'type' => 'longtext', + 'nullable' => False + )); + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_history_log','history_old_value',array( + 'type' => 'longtext', + 'nullable' => False + )); + + return $GLOBALS['setup_info']['api']['currentver'] = '17.1.003'; +}