From 480abba5e6b6395dd8314392274e041f4f018fa7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 16 Mar 2019 17:57:46 +0000 Subject: [PATCH] Introduced tt_files table. --- WEB-INF/lib/ttFileHelper.class.php | 2 +- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 10 ++++++---- mysql.sql | 26 +++++++++++++++++++++++++- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/ttFileHelper.class.php b/WEB-INF/lib/ttFileHelper.class.php index 7273d808..611df39e 100644 --- a/WEB-INF/lib/ttFileHelper.class.php +++ b/WEB-INF/lib/ttFileHelper.class.php @@ -35,7 +35,7 @@ class ttFileHelper { $this->errors = &$errors; } - // putFile - puts uploaded file in storage. + // putFile - puts uploaded file in remote storage. function putFile() { unlink($_FILES['newfile']['tmp_name']); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 22eeb9bb..c1d42357 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.18.58.4871 | Copyright © Anuko | +  Anuko Time Tracker 1.18.59.4872 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 7ecf75c4..11cd7e95 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -972,7 +972,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11855"]) { + if ($_POST["convert11797to11859"]) { ttExecute("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); @@ -1127,6 +1127,8 @@ if ($_POST) { ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.54', modified = now() where param_name = 'version_db' and param_value = '1.18.51'"); ttExecute("ALTER TABLE `tt_templates` ADD `description` varchar(255) default NULL AFTER `name`"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.55', modified = now() where param_name = 'version_db' and param_value = '1.18.54'"); + ttExecute("CREATE TABLE `tt_files` (`id` int(10) unsigned NOT NULL auto_increment,`group_id` int(10) unsigned,`org_id` int(10) unsigned,`remote_id` bigint(20) unsigned,`entity_type` varchar(32),`entity_id` int(10) unsigned,`file_name` varchar(80) COLLATE utf8mb4_bin NOT NULL,`description` varchar(255) default NULL,`created` datetime default NULL,`created_ip` varchar(45) default NULL,`created_by` int(10) unsigned,`modified` datetime default NULL,`modified_ip` varchar(45) default NULL,`modified_by` int(10) unsigned,`status` tinyint(1) default 1,PRIMARY KEY (`id`))"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.18.59', modified = now() where param_name = 'version_db' and param_value = '1.18.55'"); } if ($_POST["cleanup"]) { @@ -1176,7 +1178,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.55) + Create database structure (v1.18.59)
(applies only to new installations, do not execute when updating)
@@ -1221,8 +1223,8 @@ if ($_POST) {
Update database structure (v1.17.97 to v1.18.55)Update database structure (v1.17.97 to v1.18.59)
diff --git a/mysql.sql b/mysql.sql index eea348c0..fcc4371e 100644 --- a/mysql.sql +++ b/mysql.sql @@ -534,6 +534,30 @@ CREATE TABLE `tt_templates` ( ); +# +# Structure for table tt_files. +# This table keeps file attachment information. +# +CREATE TABLE `tt_files` ( + `id` int(10) unsigned NOT NULL auto_increment, # file id + `group_id` int(10) unsigned, # group id + `org_id` int(10) unsigned, # organization id + `remote_id` bigint(20) unsigned, # file id in storage facility + `entity_type` varchar(32), # type of entity file is associated with (project, task, etc.) + `entity_id` int(10) unsigned, # entity id + `file_name` varchar(80) COLLATE utf8mb4_bin NOT NULL, # file name + `description` varchar(255) default NULL, # file description + `created` datetime default NULL, # creation timestamp + `created_ip` varchar(45) default NULL, # creator ip + `created_by` int(10) unsigned, # creator user_id + `modified` datetime default NULL, # modification timestamp + `modified_ip` varchar(45) default NULL, # modifier ip + `modified_by` int(10) unsigned, # modifier user_id + `status` tinyint(1) default 1, # file status + PRIMARY KEY (`id`) +); + + # # Structure for table tt_site_config. This table stores configuration data # for Time Tracker site as a whole. @@ -547,4 +571,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.55', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.59', now()); # TODO: change when structure changes. -- 2.20.1