From b1e163c51d8f39b781a63a4e76cd66a2837d2ba0 Mon Sep 17 00:00:00 2001 From: "adrian.vasile.constantin" Date: Fri, 13 Jan 2012 16:36:43 +0000 Subject: [PATCH] Merged revision(s) 10027 from branches/1.5.0/modules/comment/comment.class.php: Added UNIQUE INDEX idx_module_list_order ON xe_comments(module_srl, list_order) to support textyle pages for large databases. ........ git-svn-id: http://xe-core.googlecode.com/svn/trunk@10028 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/comment/comment.class.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/comment/comment.class.php b/modules/comment/comment.class.php index e51ab28ed..7300a3645 100644 --- a/modules/comment/comment.class.php +++ b/modules/comment/comment.class.php @@ -13,8 +13,19 @@ * @brief implemented if additional tasks are required when installing **/ function moduleInstall() { + $oDB = &DB::getInstance(); + // register the action forward (for using on the admin mode) $oModuleController = &getController('module'); + + $oDB->addIndex + ( + "comments", + "idx_module_list_order", + array("module_srl", "list_order"), + true + ); + // 2007. 10. 17 add a trigger to delete comments together with posting deleted $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); // 2007. 10. 17 add a trigger to delete all of comments together with module deleted @@ -44,6 +55,9 @@ if(!$oDB->isColumnExists("comments", "blamed_count")) return true; if(!$oDB->isColumnExists("comment_voted_log", "point")) return true; + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) + return true; + return false; } @@ -80,6 +94,15 @@ if(!$oDB->isColumnExists("comment_voted_log", "point")) $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, true); + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) + $oDB->addIndex + ( + "comments", + "idx_module_list_order", + array("module_srl", "list_order"), + true + ); + return new Object(0, 'success_updated'); }