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'); }