More work in progress on subgroups.
[timetracker.git] / dbinstall.php
index 9e71651..5baff57 100644 (file)
@@ -963,8 +963,11 @@ if ($_POST) {
     setChange("UPDATE `tt_site_config` SET param_value = '1.18.00', modified = now() where param_name = 'version_db' and param_value = '1.17.97'");
     setChange("create index log_idx on tt_custom_field_log(log_id)");
     setChange("UPDATE `tt_site_config` SET param_value = '1.18.05', modified = now() where param_name = 'version_db' and param_value = '1.18.00'");
-    setChange("update `tt_groups` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.05') set org_id = id where org_id is null");
+    setChange("UPDATE `tt_groups` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.05') set org_id = id where org_id is null");
     setChange("UPDATE `tt_site_config` SET param_value = '1.18.06', modified = now() where param_name = 'version_db' and param_value = '1.18.05'");
+    setChange("ALTER TABLE `tt_users` ADD `org_id` int(11) default NULL AFTER `group_id`");
+    setChange("UPDATE `tt_users` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.06') set org_id = group_id where org_id is null");
+    setChange("UPDATE `tt_site_config` SET param_value = '1.18.07', modified = now() where param_name = 'version_db' and param_value = '1.18.06'");
   }
 
   if ($_POST["cleanup"]) {