diff --git a/timesheet/setup/setup.inc.php b/timesheet/setup/setup.inc.php index f8cc31e7de..c76a59346d 100644 --- a/timesheet/setup/setup.inc.php +++ b/timesheet/setup/setup.inc.php @@ -17,7 +17,7 @@ if (!defined('TIMESHEET_APP')) } $setup_info[TIMESHEET_APP]['name'] = TIMESHEET_APP; -$setup_info[TIMESHEET_APP]['version'] = '17.1'; +$setup_info[TIMESHEET_APP]['version'] = '17.1.001'; $setup_info[TIMESHEET_APP]['app_order'] = 5; $setup_info[TIMESHEET_APP]['tables'] = array('egw_timesheet','egw_timesheet_extra'); $setup_info[TIMESHEET_APP]['enable'] = 1; @@ -52,3 +52,4 @@ $setup_info[TIMESHEET_APP]['depends'][] = array( 'appname' => 'api', 'versions' => Array('16.1') ); + diff --git a/timesheet/setup/tables_current.inc.php b/timesheet/setup/tables_current.inc.php index 9e6c19b3de..6fc1f50c4f 100644 --- a/timesheet/setup/tables_current.inc.php +++ b/timesheet/setup/tables_current.inc.php @@ -24,11 +24,11 @@ $phpgw_baseline = array( 'ts_unitprice' => array('type' => 'float','precision' => '4','comment' => 'unitprice'), 'cat_id' => array('type' => 'int','meta' => 'category','precision' => '4','default' => '0','comment' => 'category'), 'ts_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'owner of the timesheet'), - 'ts_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'Creation date of the timesheet'), 'ts_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'date modified ot the timesheet'), 'ts_modifier' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account id of the last modifier'), 'pl_id' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'id of the linked project'), - 'ts_status' => array('type' => 'int','precision' => '4','comment' => 'status of the timesheet-entry') + 'ts_status' => array('type' => 'int','precision' => '4','comment' => 'status of the timesheet-entry'), + 'ts_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'Creation date of the timesheet') ), 'pk' => array('ts_id'), 'fk' => array(), @@ -38,8 +38,8 @@ $phpgw_baseline = array( 'egw_timesheet_extra' => array( 'fd' => array( 'ts_id' => array('type' => 'int','precision' => '4','nullable' => False), - 'ts_extra_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '32','nullable' => False), - 'ts_extra_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '255','nullable' => False,'default' => '') + 'ts_extra_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '64','nullable' => False), + 'ts_extra_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '16384','nullable' => False,'default' => '') ), 'pk' => array('ts_id','ts_extra_name'), 'fk' => array(), diff --git a/timesheet/setup/tables_update.inc.php b/timesheet/setup/tables_update.inc.php index c12ddc0ba0..5cd0cbe095 100644 --- a/timesheet/setup/tables_update.inc.php +++ b/timesheet/setup/tables_update.inc.php @@ -138,10 +138,36 @@ function timesheet_upgrade16_1() 'type' => 'int', 'meta' => 'timestamp', 'precision' => '8', - 'nullable' => False + 'nullable' => true )); // Initialize to start $GLOBALS['egw']->db->query('UPDATE egw_timesheet set ts_created = ts_start'); - + + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_created',array( + 'type' => 'int', + 'meta' => 'timestamp', + 'precision' => '8', + 'nullable' => False + )); + return $GLOBALS['setup_info']['timesheet']['currentver'] = '17.1'; -} \ No newline at end of file +} + +function timesheet_upgrade17_1() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet_extra','ts_extra_name',array( + 'type' => 'varchar', + 'meta' => 'cfname', + 'precision' => '64', + 'nullable' => False + )); + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet_extra','ts_extra_value',array( + 'type' => 'varchar', + 'meta' => 'cfvalue', + 'precision' => '16384', + 'nullable' => False, + 'default' => '' + )); + + return $GLOBALS['setup_info']['timesheet']['currentver'] = '17.1.001'; +}