]> wagnertech.de Git - timetracker.git/blobdiff - dbinstall.php
Populating tt_user_project_binds.
[timetracker.git] / dbinstall.php
index 437dac2e92c360272f700996317625c3ead05ef6..eec023683275a88b6c4a627dddf5c8d595ebff95 100644 (file)
@@ -1006,9 +1006,7 @@ if ($_POST) {
     setChange("ALTER TABLE `tt_expense_items` ADD `org_id` int(11) default NULL AFTER `group_id`");
     setChange("UPDATE `tt_site_config` SET param_value = '1.18.17', modified = now() where param_name = 'version_db' and param_value = '1.18.16'");
     setChange("UPDATE `tt_expense_items` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.17') set org_id = group_id where org_id is null");
-
-    // 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");
+    setChange("update `tt_user_project_binds` upb inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.17') inner join `tt_users` u on u.id = upb.user_id set upb.group_id = u.group_id, upb.org_id = u.org_id where upb.org_id is null");
   }
 
   if ($_POST["cleanup"]) {