Remove module update scripts from XE 1.7 and before

XE 1.7 이하 버전에서 테이블 스키마 조정, 인덱스 추가, 임시파일 처리 등을 위해
만들어 놓은 업데이트 스크립트를 대부분 제거하여 처리 효율을 향상시킵니다.

이 중 대부분은 XE 개발 초창기(1.2 이전) 스키마 변경이 빈번하던 시절에
하위호환성을 위해 추가된 것으로, 이미 10년 이상 불필요한 상태였습니다.

단, 앞으로는 XE 1.8 미만 버전에서 라이믹스로 업데이트하기 어려워질 수 있습니다.
XE 1.8 미만 버전을 사용하는 사이트에서는 먼저 XE 최신 버전으로 업데이트한 후
라이믹스를 덮어씌우는 방식으로 진행하여야 합니다.
This commit is contained in:
Kijin Sung 2020-09-29 01:33:57 +09:00
parent 0f9b96f9b4
commit 1c786d8cd5
9 changed files with 119 additions and 933 deletions

View file

@ -42,57 +42,29 @@ class comment extends ModuleObject
function checkUpdate()
{
$oDB = DB::getInstance();
$oModuleModel = getModel('module');
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
{
return TRUE;
}
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
{
return TRUE;
}
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
if(!$oDB->isColumnExists("comments", "voted_count"))
{
return TRUE;
}
if(!$oDB->isColumnExists("comments", "notify_message"))
if(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
{
return TRUE;
}
// 2008. 02. 22 add comment setting when a new module added
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
{
return TRUE;
}
// 2008. 05. 14 add a column for blamed count
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;
}
//2012. 02. 24 add comment published status column and index
if(!$oDB->isColumnExists("comments", "status"))
{
return TRUE;
}
if(!$oDB->isIndexExists("comments", "idx_status"))
{
return TRUE;
}
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
{
return TRUE;
}
@ -114,16 +86,17 @@ class comment extends ModuleObject
return true;
}
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
{
return true;
}
if(!$oModuleModel->getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
{
return true;
}
return FALSE;
return false;
}
/**
@ -133,66 +106,30 @@ class comment extends ModuleObject
function moduleUpdate()
{
$oDB = DB::getInstance();
$oModuleModel = getModel('module');
$oModuleController = getController('module');
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
{
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
}
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
if(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
{
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
}
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
if(!$oDB->isColumnExists("comments", "voted_count"))
{
$oDB->addColumn("comments", "voted_count", "number", "11");
$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
}
if(!$oDB->isColumnExists("comments", "notify_message"))
{
$oDB->addColumn("comments", "notify_message", "char", "1");
}
// 2008. 02. 22 add comment setting when a new module added
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
{
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
}
// 2008. 05. 14 add a column for blamed count
if(!$oDB->isColumnExists("comments", "blamed_count"))
{
$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
}
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
);
}
//2012. 02. 24 add comment published status column and index
if(!$oDB->isColumnExists("comments", "status"))
{
$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
}
if(!$oDB->isIndexExists("comments", "idx_status"))
{
$oDB->addIndex(
"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
);
$oDB->addIndex("comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE);
}
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
}
@ -214,11 +151,12 @@ class comment extends ModuleObject
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
}
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
// 2018.01.24 Improve mass file deletion
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
{
$oModuleController->insertTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after');
}
if(!$oModuleModel->getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
{
$oModuleController->insertTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add');
}