diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index 79d269ae6a..0758b549b4 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'; +$setup_info['api']['version'] = '20.1.001'; $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.20201005'; @@ -52,6 +52,7 @@ $setup_info['api']['tables'][] = 'egw_ea_credentials'; $setup_info['api']['tables'][] = 'egw_ea_identities'; $setup_info['api']['tables'][] = 'egw_ea_valid'; $setup_info['api']['tables'][] = 'egw_ea_notifications'; +$setup_info['api']['tables'][] = 'egw_addressbook_shared'; // hooks used by vfs_home_hooks to manage user- and group-directories for the new stream based VFS $setup_info['api']['hooks']['addaccount'] = array('EGroupware\\Api\\Vfs\\Hooks::addAccount', 'EGroupware\\Api\\Mail\\Hooks::addaccount'); @@ -139,3 +140,4 @@ $setup_info['groupdav']['author'] = $setup_info['groupdav']['maintainer'] = arra $setup_info['groupdav']['license'] = 'GPL'; $setup_info['groupdav']['hooks']['preferences'] = 'EGroupware\\Api\\CalDAV\\Hooks::menus'; $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 a5486597bd..9c5f443216 100644 --- a/api/setup/tables_current.inc.php +++ b/api/setup/tables_current.inc.php @@ -510,5 +510,19 @@ $phpgw_baseline = array( 'fk' => array(), 'ix' => array(array('account_id','acc_id')), 'uc' => array() + ), + 'egw_addressbook_shared' => array( + 'fd' => array( + 'shared_id' => array('type' => 'auto','nullable' => False), + 'contact_id' => array('type' => 'int','precision' => '4','nullable' => False), + 'shared_with' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False), + 'shared_by' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False), + 'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), + 'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0') + ), + 'pk' => array('shared_id'), + 'fk' => array(), + 'ix' => array('contact_id','shared_with'), + 'uc' => array() ) ); diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index 3f996418a6..65867c8174 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -728,3 +728,28 @@ function api_upgrade19_1_004() { return $GLOBALS['setup_info']['api']['currentver'] = '20.1'; } + +/** + * Table for per-contact sharing + * + * @return string + */ +function api_upgrade20_1() +{ + $GLOBALS['egw_setup']->oProc->CreateTable('egw_addressbook_shared',array( + 'fd' => array( + 'shared_id' => array('type' => 'auto','nullable' => False), + 'contact_id' => array('type' => 'int','precision' => '4','nullable' => False), + 'shared_with' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False), + 'shared_by' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False), + 'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), + 'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0') + ), + 'pk' => array('shared_id'), + 'fk' => array(), + 'ix' => array('contact_id','shared_with'), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['api']['currentver'] = '20.1.001'; +}