From 57babce3424b88837a797860b52b9546908d478f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 19 Nov 2018 13:07:53 +0000 Subject: [PATCH] Introduced org_id in tt_cron table as part of subgroup support work. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 10 ++++++---- mysql.sql | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 463340b7..397c6600 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.18.19.4455 | Copyright © Anuko | +  Anuko Time Tracker 1.18.20.4456 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 0d8ea9a4..6497dbbf 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -957,7 +957,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11819"]) { + if ($_POST["convert11797to11820"]) { setChange("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); setChange("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); setChange("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); @@ -1014,6 +1014,8 @@ if ($_POST) { setChange("ALTER TABLE `tt_fav_reports` ADD `org_id` int(11) default NULL AFTER `group_id`"); setChange("UPDATE `tt_site_config` SET param_value = '1.18.19', modified = now() where param_name = 'version_db' and param_value = '1.18.18'"); setChange("update `tt_fav_reports` fr inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.19') inner join `tt_users` u on u.id = fr.user_id set fr.group_id = u.group_id, fr.org_id = u.org_id where fr.org_id is null"); + setChange("ALTER TABLE `tt_cron` ADD `org_id` int(11) default NULL AFTER `group_id`"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.20', modified = now() where param_name = 'version_db' and param_value = '1.18.19'"); } if ($_POST["cleanup"]) { @@ -1060,7 +1062,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.19) + Create database structure (v1.18.20)
(applies only to new installations, do not execute when updating)
@@ -1105,8 +1107,8 @@ if ($_POST) {
Update database structure (v1.17.97 to v1.18.19)Update database structure (v1.17.97 to v1.18.20)
diff --git a/mysql.sql b/mysql.sql index d5dbe410..e3f0bd83 100644 --- a/mysql.sql +++ b/mysql.sql @@ -296,6 +296,7 @@ CREATE TABLE `tt_fav_reports` ( CREATE TABLE `tt_cron` ( `id` int(11) NOT NULL auto_increment, # entry id `group_id` int(11) NOT NULL, # group id + `org_id` int(11) default NULL, # organization id `cron_spec` varchar(255) NOT NULL, # cron specification, "0 1 * * *" for "daily at 01:00" `last` int(11) default NULL, # UNIX timestamp of when job was last run `next` int(11) default NULL, # UNIX timestamp of when to run next job @@ -475,4 +476,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.19', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.20', now()); # TODO: change when structure changes. -- 2.20.1