missing database update for contact sharing

This commit is contained in:
Ralf Becker 2020-10-19 11:56:00 +02:00
parent fa98eb1071
commit e0d04b09c5
3 changed files with 21 additions and 3 deletions

View File

@ -11,7 +11,7 @@
/* Basic information about this app */ /* Basic information about this app */
$setup_info['api']['name'] = 'api'; $setup_info['api']['name'] = 'api';
$setup_info['api']['title'] = 'EGroupware API'; $setup_info['api']['title'] = 'EGroupware API';
$setup_info['api']['version'] = '20.1.001'; $setup_info['api']['version'] = '20.1.002';
$setup_info['api']['versions']['current_header'] = '1.29'; $setup_info['api']['versions']['current_header'] = '1.29';
// maintenance release in sync with changelog in doc/rpm-build/debian.changes // maintenance release in sync with changelog in doc/rpm-build/debian.changes
$setup_info['api']['versions']['maintenance_release'] = '20.1.20201005'; $setup_info['api']['versions']['maintenance_release'] = '20.1.20201005';
@ -141,3 +141,4 @@ $setup_info['groupdav']['license'] = 'GPL';
$setup_info['groupdav']['hooks']['preferences'] = 'EGroupware\\Api\\CalDAV\\Hooks::menus'; $setup_info['groupdav']['hooks']['preferences'] = 'EGroupware\\Api\\CalDAV\\Hooks::menus';
$setup_info['groupdav']['hooks']['settings'] = 'EGroupware\\Api\\CalDAV\\Hooks::settings'; $setup_info['groupdav']['hooks']['settings'] = 'EGroupware\\Api\\CalDAV\\Hooks::settings';

View File

@ -518,11 +518,12 @@ $phpgw_baseline = array(
'shared_with' => array('type' => 'int','meta' => 'account','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_by' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False),
'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'), 'shared_at' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0') 'shared_writable' => array('type' => 'bool','nullable' => False,'default' => '0'),
'shared_deleted' => array('type' => 'timestamp','comment' => 'timestamp, if deleted')
), ),
'pk' => array('shared_id'), 'pk' => array('shared_id'),
'fk' => array(), 'fk' => array(),
'ix' => array('contact_id','shared_with'), 'ix' => array('contact_id','shared_with'),
'uc' => array() 'uc' => array(array('shared_by','shared_with','contact_id'))
) )
); );

View File

@ -753,3 +753,19 @@ function api_upgrade20_1()
return $GLOBALS['setup_info']['api']['currentver'] = '20.1.001'; return $GLOBALS['setup_info']['api']['currentver'] = '20.1.001';
} }
/**
* Add deleted timestamp and unique index for contact sharing
*
* @return string
*/
function api_upgrade20_1_001()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook_shared','shared_deleted',array(
'type' => 'timestamp',
'comment' => 'timestamp, if deleted'
));
$GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook_shared', array('shared_by','shared_with','contact_id'), true);
return $GLOBALS['setup_info']['api']['currentver'] = '20.1.002';
}