Commit 4e1a2f251bae708f4ce0e8747a6bb6004cdc401c

Authored by Conrad Vermeulen
1 parent f9ee4a1f

KTS-3765

"Add index on user_id on document_transactions table."
Implemented.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9428 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/database/schema.inc.php
... ... @@ -9,31 +9,31 @@
9 9 * Document Management Made Simple
10 10 * Copyright (C) 2008 KnowledgeTree Inc.
11 11 * Portions copyright The Jam Warehouse Software (Pty) Limited
12   - *
  12 + *
13 13 * This program is free software; you can redistribute it and/or modify it under
14 14 * the terms of the GNU General Public License version 3 as published by the
15 15 * Free Software Foundation.
16   - *
  16 + *
17 17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 19 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 20 * details.
21   - *
  21 + *
22 22 * You should have received a copy of the GNU General Public License
23 23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24   - *
25   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  24 + *
  25 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
26 26 * California 94120-7775, or email info@knowledgetree.com.
27   - *
  27 + *
28 28 * The interactive user interfaces in modified source and object code versions
29 29 * of this program must display Appropriate Legal Notices, as required under
30 30 * Section 5 of the GNU General Public License version 3.
31   - *
  31 + *
32 32 * In accordance with Section 7(b) of the GNU General Public License version 3,
33 33 * these Appropriate Legal Notices must retain the display of the "Powered by
34   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  34 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
35 35 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
36   - * must display the words "Powered by KnowledgeTree" and retain the original
  36 + * must display the words "Powered by KnowledgeTree" and retain the original
37 37 * copyright notice.
38 38 * Contributor( s): ______________________________________
39 39 */
... ... @@ -568,6 +568,7 @@ class KTSchemaUtil
568 568 $this->defineIndex('document_transaction_types_lookup','namespace', 'UNIQUE');
569 569  
570 570 $this->defineIndex('document_transactions','session_id');
  571 + $this->defineIndex('document_transactions','user_id');
571 572 $this->defineIndex('document_transactions','document_id');
572 573  
573 574 $this->defineIndex('document_types_lookup','name');
... ...
sql/mysql/install/data.sql
... ... @@ -1724,7 +1724,8 @@ INSERT INTO `upgrades` VALUES
1724 1724 (203,'sql*3.5.3*0*3.5.3/saved_search.sql','Fix saved search table to support long expressions.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1725 1725 (204,'sql*3.5.3*0*3.5.3/preview_column.sql','Adjust Preview Column.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1726 1726 (205,'sql*3.5.3*0*3.5.3/tag_cloud.sql','Update TagCloud descritption.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1727   -(206,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
  1727 +(206,'sql*3.5.3*0*3.5.3/doc_tran_user_index.sql','Add index on user_id to document transactions table.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1728 +(207,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
1728 1729 /*!40000 ALTER TABLE `upgrades` ENABLE KEYS */;
1729 1730 UNLOCK TABLES;
1730 1731  
... ... @@ -2655,7 +2656,7 @@ UNLOCK TABLES;
2655 2656 LOCK TABLES `zseq_upgrades` WRITE;
2656 2657 /*!40000 ALTER TABLE `zseq_upgrades` DISABLE KEYS */;
2657 2658 INSERT INTO `zseq_upgrades` VALUES
2658   -(206);
  2659 +(207);
2659 2660 /*!40000 ALTER TABLE `zseq_upgrades` ENABLE KEYS */;
2660 2661 UNLOCK TABLES;
2661 2662  
... ...
sql/mysql/install/structure.sql
... ... @@ -523,6 +523,7 @@ CREATE TABLE `document_transactions` (
523 523 PRIMARY KEY (`id`),
524 524 KEY `session_id` (`session_id`),
525 525 KEY `document_id` (`document_id`),
  526 + KEY `user_id` (`user_id`),
526 527 KEY `datetime` (`datetime`,`transaction_namespace`)
527 528 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
528 529  
... ...
sql/mysql/upgrade/3.5.3/doc_tran_user_index.sql 0 → 100644
  1 +alter table `ktdms`.`document_transactions` add index `user_id` (`user_id`);
0 2 \ No newline at end of file
... ...