Introduced an index in tt_project_task_binds to eliminate duplicates.
authorNik Okuntseff <support@anuko.com>
Sun, 18 Nov 2018 18:14:03 +0000 (18:14 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 18 Nov 2018 18:14:03 +0000 (18:14 +0000)
WEB-INF/templates/footer.tpl
dbinstall.php
mysql.sql

index 7eb7048..f66ff9b 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.17.4449 | 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.17.4450 | 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 ef895bd..e3561ed 100644 (file)
@@ -1008,6 +1008,7 @@ if ($_POST) {
     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");
     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");
     setChange("update `tt_project_task_binds` ptb inner join tt_site_config sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.17') inner join `tt_projects` p on p.id = ptb.project_id set ptb.group_id = p.group_id, ptb.org_id = p.org_id where ptb.org_id is null");
+    setChange("create unique index project_task_idx on tt_project_task_binds(project_id, task_id)");
   }
 
   if ($_POST["cleanup"]) {
index 5ee9ad4..23dbb14 100644 (file)
--- a/mysql.sql
+++ b/mysql.sql
@@ -177,6 +177,7 @@ CREATE TABLE `tt_project_task_binds` (
 # Indexes for tt_project_task_binds.
 create index project_idx on tt_project_task_binds(project_id);
 create index task_idx on tt_project_task_binds(task_id);
+create unique index project_tax_idx on tt_project_task_binds(project_id, task_id);
 
 
 #
@@ -472,4 +473,4 @@ CREATE TABLE `tt_site_config` (
   PRIMARY KEY  (`param_name`)
 );
 
-INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.17', now()); # TODO: change when structure changes.
+INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.18', now()); # TODO: change when structure changes.