Added an index to tt_client_project_binds to guarantee uniqueness.
authorNik Okuntseff <support@anuko.com>
Mon, 19 Nov 2018 17:01:51 +0000 (17:01 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 19 Nov 2018 17:01:51 +0000 (17:01 +0000)
WEB-INF/templates/footer.tpl
dbinstall.php
mysql.sql

index 8d292fc..cab56b7 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.21.4461 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.21.4462 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index bfbb5c2..6024491 100644 (file)
@@ -1021,6 +1021,7 @@ if ($_POST) {
     setChange("ALTER TABLE `tt_client_project_binds` ADD `org_id` int(11) default NULL AFTER `group_id`");
     setChange("update `tt_client_project_binds` cpb inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.20') inner join `tt_clients` c on c.id = cpb.client_id set cpb.group_id = c.group_id, cpb.org_id = c.org_id where cpb.org_id is null");
     setChange("UPDATE `tt_site_config` SET param_value = '1.18.21', modified = now() where param_name = 'version_db' and param_value = '1.18.20'");
+    setChange("create unique index client_project_idx on tt_client_project_binds(client_id, project_id)");
   }
 
   if ($_POST["cleanup"]) {
index 705e664..bc970f7 100644 (file)
--- a/mysql.sql
+++ b/mysql.sql
@@ -342,6 +342,7 @@ CREATE TABLE `tt_client_project_binds` (
 # Indexes for tt_client_project_binds.
 create index client_idx on tt_client_project_binds(client_id);
 create index project_idx on tt_client_project_binds(project_id);
+create unique index client_project_idx on tt_client_project_binds(client_id, project_id);
 
 
 #