Started to populate org_id in tt_log and tt_invoices tables.
[timetracker.git] / dbinstall.php
index a2ff433..1c5fa90 100644 (file)
@@ -982,6 +982,8 @@ if ($_POST) {
     setChange("ALTER TABLE `tt_log` ADD `org_id` int(11) default NULL AFTER `group_id`");
     setChange("ALTER TABLE `tt_invoices` ADD `org_id` int(11) default NULL AFTER `group_id`");
     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");
   }
 
   if ($_POST["cleanup"]) {