From c0ddf2c276ccbb7480ab690edfbd6c6e42a3ae39 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 7 Nov 2018 22:40:17 +0000 Subject: [PATCH] Added org_id to a couple more tables. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 3 +++ mysql.sql | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 8da3be0e..b56b168d 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.10.4383 | Copyright © Anuko | +  Anuko Time Tracker 1.18.11.4384 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index e77c24b9..9a87d38e 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -979,6 +979,9 @@ if ($_POST) { setChange("UPDATE `tt_site_config` SET param_value = '1.18.10', modified = now() where param_name = 'version_db' and param_value = '1.18.09'"); setChange("UPDATE `tt_projects` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.10') set org_id = group_id where org_id is null"); setChange("UPDATE `tt_tasks` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.10') set org_id = group_id where org_id is null"); + setChange("ALTER TABLE `tt_log` ADD `org_id` int(11) default NULL AFTER `group_id`"); + setChange("ALTER TABLE `tt_invoices` ADD `org_id` int(11) default NULL AFTER `group_id`"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.11', modified = now() where param_name = 'version_db' and param_value = '1.18.10'"); } if ($_POST["cleanup"]) { diff --git a/mysql.sql b/mysql.sql index 32ba202e..396fd2d2 100644 --- a/mysql.sql +++ b/mysql.sql @@ -183,6 +183,7 @@ CREATE TABLE `tt_log` ( `id` bigint NOT NULL auto_increment, # time record id `user_id` int(11) NOT NULL, # user id `group_id` int(11) default NULL, # group id + `org_id` int(11) default NULL, # organization id `date` date NOT NULL, # date the record is for `start` time default NULL, # record start time (for example, 09:00) `duration` time default NULL, # record duration (for example, 1 hour) @@ -219,6 +220,7 @@ create index task_idx on tt_log(task_id); CREATE TABLE `tt_invoices` ( `id` int(11) NOT NULL auto_increment, # invoice id `group_id` int(11) NOT NULL, # group id + `org_id` int(11) default NULL, # organization id `name` varchar(80) COLLATE utf8_bin NOT NULL, # invoice name `date` date NOT NULL, # invoice date `client_id` int(11) NOT NULL, # client id @@ -463,4 +465,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.10', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.11', now()); # TODO: change when structure changes. -- 2.20.1