From 3ab851550ce837b96861f528b35c86fc627e3c46 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Feb 2021 17:33:54 +0200 Subject: [PATCH] neccessary schema update to support further credential-types --- api/setup/setup.inc.php | 3 ++- api/setup/tables_current.inc.php | 2 +- api/setup/tables_update.inc.php | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index 7c4e1a2e50..6931143177 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'] = '20.1.002'; +$setup_info['api']['version'] = '20.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'] = '20.1.20210125'; @@ -142,3 +142,4 @@ $setup_info['groupdav']['hooks']['preferences'] = 'EGroupware\\Api\\CalDAV\\Hook $setup_info['groupdav']['hooks']['settings'] = 'EGroupware\\Api\\CalDAV\\Hooks::settings'; + diff --git a/api/setup/tables_current.inc.php b/api/setup/tables_current.inc.php index ed0e42d763..648233fe5b 100644 --- a/api/setup/tables_current.inc.php +++ b/api/setup/tables_current.inc.php @@ -462,7 +462,7 @@ $phpgw_baseline = array( 'fd' => array( 'cred_id' => array('type' => 'auto','nullable' => False), 'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'into egw_ea_accounts'), - 'cred_type' => array('type' => 'int','precision' => '1','nullable' => False,'comment' => '&1=imap, &2=smtp, &4=admin'), + 'cred_type' => array('type' => 'int','precision' => '2','nullable' => False,'comment' => '&1=imap, &2=smtp, &4=admin'), 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account_id or 0=all'), 'cred_username' => array('type' => 'varchar','precision' => '80','nullable' => False,'comment' => 'username'), 'cred_password' => array('type' => 'varchar','precision' => '16384','comment' => 'password encrypted'), diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index e83e33c123..0b7e49a5e0 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -769,3 +769,16 @@ function api_upgrade20_1_001() return $GLOBALS['setup_info']['api']['currentver'] = '20.1.002'; } + +function api_upgrade20_1_002() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_ea_credentials','cred_type',array( + 'type' => 'int', + 'precision' => '2', + 'nullable' => False, + 'comment' => '&1=imap, &2=smtp, &4=admin' + )); + + return $GLOBALS['setup_info']['api']['currentver'] = '20.1.003'; +} +