From 1a7f5dda663493a6ea33a86a58b3caab7fd94062 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 16 Nov 2018 00:04:10 +0000 Subject: [PATCH] Fixed mysql.sql for new installs - one table was not being created. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 9 +++++---- mysql.sql | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index c45141d0..cb9bed06 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.18.12.4429 | Copyright © Anuko | +  Anuko Time Tracker 1.18.13.4430 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index d150e735..8a6d66fd 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -956,7 +956,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11812"]) { + if ($_POST["convert11797to11813"]) { 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`"); @@ -989,6 +989,7 @@ if ($_POST) { setChange("ALTER TABLE `tt_project_task_binds` ADD `group_id` int(11) default NULL AFTER `task_id`"); setChange("ALTER TABLE `tt_project_task_binds` ADD `org_id` int(11) default NULL AFTER `group_id`"); setChange("UPDATE `tt_site_config` SET param_value = '1.18.12', modified = now() where param_name = 'version_db' and param_value = '1.18.11'"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.13', modified = now() where param_name = 'version_db' and param_value = '1.18.12'"); // TODO: this does not work as we just introduced group_id and it is NULL. Same for tt_project_task_binds. Improve. // setChange("UPDATE `tt_user_project_binds` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.12') set org_id = group_id where org_id is null"); } @@ -1036,7 +1037,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.12) + Create database structure (v1.18.13)
(applies only to new installations, do not execute when updating)
@@ -1081,8 +1082,8 @@ if ($_POST) {
Update database structure (v1.17.97 to v1.18.12)Update database structure (v1.17.97 to v1.18.13)
diff --git a/mysql.sql b/mysql.sql index 5237dfe3..1b510a73 100644 --- a/mysql.sql +++ b/mysql.sql @@ -169,9 +169,9 @@ create unique index bind_idx on tt_user_project_binds(user_id, project_id); # CREATE TABLE `tt_project_task_binds` ( `project_id` int(11) NOT NULL, # project id - `task_id` int(11) NOT NULL # task id + `task_id` int(11) NOT NULL, # task id `group_id` int(11) default NULL, # group id - `org_id` int(11) default NULL, # organization id + `org_id` int(11) default NULL # organization id ); # Indexes for tt_project_task_binds. @@ -469,4 +469,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.12', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.13', now()); # TODO: change when structure changes. -- 2.20.1