X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=dbinstall.php;h=d150e7350e77ed0340ed4384910532ae6766ee69;hb=252197d9417610f49c555a454995e0949741a01e;hp=1c5fa900988d0ea5059dfae37abd1384cd093579;hpb=3c5f822f90846e9a65866c9e33b7e1ff81b46b1f;p=timetracker.git diff --git a/dbinstall.php b/dbinstall.php index 1c5fa900..d150e735 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["convert11797to11811"]) { + if ($_POST["convert11797to11812"]) { 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`"); @@ -984,6 +984,13 @@ if ($_POST) { setChange("UPDATE `tt_site_config` SET param_value = '1.18.11', modified = now() where param_name = 'version_db' and param_value = '1.18.10'"); setChange("UPDATE `tt_log` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.11') set org_id = group_id where org_id is null"); setChange("UPDATE `tt_invoices` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.11') set org_id = group_id where org_id is null"); + setChange("ALTER TABLE `tt_user_project_binds` ADD `group_id` int(11) default NULL AFTER `project_id`"); + setChange("ALTER TABLE `tt_user_project_binds` ADD `org_id` int(11) default NULL AFTER `group_id`"); + 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'"); + // 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"); } if ($_POST["cleanup"]) { @@ -1029,7 +1036,7 @@ if ($_POST) {

DB Install

-
Create database structure (v1.18.11) + Create database structure (v1.18.12)
(applies only to new installations, do not execute when updating)
@@ -1074,8 +1081,8 @@ if ($_POST) { - Update database structure (v1.17.97 to v1.18.11) - + Update database structure (v1.17.97 to v1.18.12) +