From 4a5bfd260ac12011d9960e7934595ff00e2d020d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 9 Aug 2016 15:47:52 +0200 Subject: [PATCH] W.I.P. collab editor: Create collab tables in DB --- filemanager/setup/setup.inc.php | 6 ++- filemanager/setup/tables_current.php | 57 ++++++++++++++++++++++ filemanager/setup/tables_update.inc.php | 64 +++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 filemanager/setup/tables_current.php create mode 100644 filemanager/setup/tables_update.inc.php diff --git a/filemanager/setup/setup.inc.php b/filemanager/setup/setup.inc.php index 81c9e5b403..07fcf6ee47 100755 --- a/filemanager/setup/setup.inc.php +++ b/filemanager/setup/setup.inc.php @@ -10,11 +10,13 @@ $setup_info['filemanager']['name'] = 'filemanager'; $setup_info['filemanager']['title'] = 'Filemanager'; -$setup_info['filemanager']['version'] = '16.1'; +$setup_info['filemanager']['version'] = '16.2'; $setup_info['filemanager']['app_order'] = 6; $setup_info['filemanager']['enable'] = 1; $setup_info['filemanager']['index'] = 'filemanager.filemanager_ui.index&ajax=true'; +$setup_info['filemanager']['tables'] = array('egw_collab_member', 'egw_collab_op', 'egw_collab_session'); + $setup_info['filemanager']['author'] = $setup_info['filemanager']['maintainer'] = array( 'name' => 'Ralf Becker', @@ -34,4 +36,4 @@ $setup_info['filemanager']['hooks']['search_link'] = 'filemanager_hooks::search_ $setup_info['filemanager']['depends'][] = array( 'appname' => 'api', 'versions' => array('16.1') -); +); \ No newline at end of file diff --git a/filemanager/setup/tables_current.php b/filemanager/setup/tables_current.php new file mode 100644 index 0000000000..05990fef8d --- /dev/null +++ b/filemanager/setup/tables_current.php @@ -0,0 +1,57 @@ + + * @package filemanager + * @subpackage setup + * @copyright (c) 2016 by Stylite AG + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + +$phpgw_baseline = array( + 'egw_collab_member' => array( + 'fd' => array( + 'collab_member_id' => array('type' => 'auto','nullable' => False, 'comment' => 'Unique per user and session'), + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Related editing session id'), + 'collab_uid' => array('type' => 'varchar','precision' => '64'), + 'collab_color' => array('type' => 'varchar','precision' => '32'), + 'collab_last_activity' => array('type' => 'int','precision' => '4'), + 'collab_is_guest' => array('type' => 'int','precision' => '2','default' => '0','nullable' => False), + 'collab_token' => array('type' => 'varchar','precision' => '32'), + 'collab_status' => array('type' => 'int','precision' => '2','default' => '1','nullable' => False) + ), + 'pk' => array('collab_member_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + ), + 'egw_collab_op' => array( + 'fd' => array( + 'collab_seq' => array('type' => 'auto','nullable' => False, 'comment' => 'Sequence number'), + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Editing session id'), + 'collab_member' => array('type' => 'int','precision' => '4','default' => '1','nullable' => False, 'comment' => 'User and time specific'), + 'collab_optype' => array('type' => 'varchar','precision' => '64', 'comment' => 'Operation type'), + 'collab_opspec' => array('type' => 'longtext', 'comment' => 'json-string') + ), + 'pk' => array('collab_seq'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + ), + 'egw_collab_session' => array( + 'fd' => array( + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Editing session id'), + 'collab_genesis_url' => array('type' => 'varchar','precision' => '512', 'comment' => 'Relative to owner documents storage /template.odt'), + 'collab_genesis_hash' => array('type' => 'varchar','precision' => '128','nullable' => False, 'comment' => 'To be sure the genesis did not change'), + 'collab_file_id' => array('type' => 'varchar','precision' => '512', 'comment' => 'Relative to storage e.g. /template.odt'), + 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False, 'comment' => 'user who created the session') + ), + 'pk' => array('collab_es_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + ) +); diff --git a/filemanager/setup/tables_update.inc.php b/filemanager/setup/tables_update.inc.php new file mode 100644 index 0000000000..48f6ee9d19 --- /dev/null +++ b/filemanager/setup/tables_update.inc.php @@ -0,0 +1,64 @@ +oProc->CreateTable('egw_collab_member', array( + 'fd' => array( + 'collab_member_id' => array('type' => 'auto','nullable' => False, 'comment' => 'Unique per user and session'), + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Related editing session id'), + 'collab_uid' => array('type' => 'varchar','precision' => '64'), + 'collab_color' => array('type' => 'varchar','precision' => '32'), + 'collab_last_activity' => array('type' => 'int','precision' => '4'), + 'collab_is_guest' => array('type' => 'int','precision' => '2','default' => '0','nullable' => False), + 'collab_token' => array('type' => 'varchar','precision' => '32'), + 'collab_status' => array('type' => 'int','precision' => '2','default' => '1','nullable' => False) + ), + 'pk' => array('collab_member_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + )); + + $GLOBALS['egw_setup']->oProc->CreateTable('egw_collab_op', array( + 'fd' => array( + 'collab_seq' => array('type' => 'auto','nullable' => False, 'comment' => 'Sequence number'), + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Editing session id'), + 'collab_member' => array('type' => 'int','precision' => '4','default' => '1','nullable' => False, 'comment' => 'User and time specific'), + 'collab_optype' => array('type' => 'varchar','precision' => '64', 'comment' => 'Operation type'), + 'collab_opspec' => array('type' => 'longtext', 'comment' => 'json-string') + ), + 'pk' => array('collab_seq'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + )); + + $GLOBALS['egw_setup']->oProc->CreateTable('egw_collab_session', array( + 'fd' => array( + 'collab_es_id' => array('type' => 'varchar','precision' => '64','nullable' => False, 'comment' => 'Editing session id'), + 'collab_genesis_url' => array('type' => 'varchar','precision' => '512', 'comment' => 'Relative to owner documents storage /template.odt'), + 'collab_genesis_hash' => array('type' => 'varchar','precision' => '128','nullable' => False, 'comment' => 'To be sure the genesis did not change'), + 'collab_file_id' => array('type' => 'varchar','precision' => '512', 'comment' => 'Relative to storage e.g. /template.odt'), + 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False, 'comment' => 'user who created the session') + ), + 'pk' => array('collab_es_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['activesync']['currentver'] = '16.2'; +} \ No newline at end of file