From: Nik Okuntseff Date: Sat, 17 Nov 2018 13:33:04 +0000 (+0000) Subject: Introduced org_id in tt_predefined_expenses table. X-Git-Tag: timetracker_1.19-1~633 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b50c69326fc036816418d39d04ff58062421644d;p=timetracker.git Introduced org_id in tt_predefined_expenses table. --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 4923429a..a7e71cff 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - + +
 Anuko Time Tracker 1.18.15.4438 | Copyright © Anuko | +  Anuko Time Tracker 1.18.16.4439 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 0c26a457..23eac730 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["convert11797to11815"]) { + if ($_POST["convert11797to11816"]) { 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`"); @@ -1000,6 +1000,8 @@ if ($_POST) { setChange("ALTER TABLE `tt_monthly_quotas` ADD `org_id` int(11) default NULL AFTER `group_id`"); setChange("UPDATE `tt_monthly_quotas` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.14') set org_id = group_id where org_id is null"); setChange("UPDATE `tt_site_config` SET param_value = '1.18.15', modified = now() where param_name = 'version_db' and param_value = '1.18.14'"); + setChange("ALTER TABLE `tt_predefined_expenses` ADD `org_id` int(11) default NULL AFTER `group_id`"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.16', modified = now() where param_name = 'version_db' and param_value = '1.18.15'"); // 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"); @@ -1048,7 +1050,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.15) + Create database structure (v1.18.16)
(applies only to new installations, do not execute when updating)
@@ -1093,8 +1095,8 @@ if ($_POST) {
Update database structure (v1.17.97 to v1.18.15)Update database structure (v1.17.97 to v1.18.16)
diff --git a/mysql.sql b/mysql.sql index 14fa2aab..9a6030c1 100644 --- a/mysql.sql +++ b/mysql.sql @@ -437,6 +437,7 @@ create index invoice_idx on tt_expense_items(invoice_id); CREATE TABLE `tt_predefined_expenses` ( `id` int(11) NOT NULL auto_increment, # predefined expense id `group_id` int(11) NOT NULL, # group id + `org_id` int(11) default NULL, # organization id `name` varchar(255) NOT NULL, # predefined expense name, such as mileage `cost` decimal(10,2) default '0.00', # cost for one unit PRIMARY KEY (`id`) @@ -470,4 +471,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.15', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.16', now()); # TODO: change when structure changes.